Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(): info mapping #1452

Open
wants to merge 2 commits into
base: v1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public Swagger convert(ResourceListing resourceListing, List<ApiDeclaration> api
Contact contact = null;
if (apiInfo.getContact() != null) {
contact = new Contact()
.url(apiInfo.getContact());
.email(apiInfo.getContact());
}
License license = null;
if (apiInfo.getLicense() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,12 @@ public void testIssue_641()throws IOException {
BodyParameter bodyParameter = (BodyParameter) swagger2.getPaths().get("/user/createWithArray").getPost().getParameters().get(0);
assertEquals(((RefProperty)((ArrayModel)bodyParameter.getSchema()).getItems()).get$ref(),"#/definitions/User");
}

@Test
public void testIssue_1451()throws IOException {
SwaggerCompatConverter converter = new SwaggerCompatConverter();
Swagger swagger2 = converter.read("specs/v1_2/issue-1451.json");
assertNotNull(swagger2);
assertEquals(swagger2.getInfo().getContact().getEmail(), "apiteam@swagger.io");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"basePath": "http://petstore.swagger.io/api",
"info": {
"contact": "apiteam@swagger.io"
},
"apis": [
{
"path": "/test"
}
]
}