We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, according to the 1.2 version of Swagger specs, info.contact is used for email. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/1.2.md#513-info-object
info.contact
However, in the SwaggerCompatConverter, the contact field is put into url https://github.com/swagger-api/swagger-parser/blob/v1/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java#L554-L555
SwaggerCompatConverter
contact
url
Contact contact = null; if (apiInfo.getContact() != null) { contact = new Contact() .url(apiInfo.getContact()); }
It should be "email".
As a consequence, when I parse this swagger descriptor in version 1.2 with OpenAPIParser:
OpenAPIParser
{ "apiVersion": "1.2.3", "swaggerVersion": "1.2", "info": { "title": "My title", "description": "My description", "termsOfServiceUrl": "http://swagger.io/terms/", "contact": "apiteam@swagger.io", "license": "Apache 2.0", "licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html" } ...
I get this OpenAPI descriptor:
openapi: 3.0.1 info: title: My title description: My description termsOfService: http://swagger.io/terms/ contact: url: apiteam@swagger.io license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html version: 1.2.3 ...
which is not valid, since info.contact.url must be in the format of a URL (https://swagger.io/specification/#contact-object)
info.contact.url
The text was updated successfully, but these errors were encountered:
fix(): info mapping
942e765
Put swagger 1.2 `contact` field into swagger 2 `contact.email` field instead of url Fixes swagger-api#1451
It seems that what I propose is in conflict with LegacyConverterTest.
LegacyConverterTest
Sorry, something went wrong.
@gracekarina what do you think is the best option ?
or
SwaggerConverter
No branches or pull requests
Hi,
according to the 1.2 version of Swagger specs,
info.contact
is used for email.https://github.com/OAI/OpenAPI-Specification/blob/master/versions/1.2.md#513-info-object
However, in the
SwaggerCompatConverter
, thecontact
field is put intourl
https://github.com/swagger-api/swagger-parser/blob/v1/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java#L554-L555
It should be "email".
As a consequence, when I parse this swagger descriptor in version 1.2 with
OpenAPIParser
:I get this OpenAPI descriptor:
which is not valid, since
info.contact.url
must be in the format of a URL (https://swagger.io/specification/#contact-object)The text was updated successfully, but these errors were encountered: