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

Swagger-Editor 3.5.7, Responses Examples are not interpreted #1785

Closed
younss opened this issue Jun 12, 2018 · 3 comments
Closed

Swagger-Editor 3.5.7, Responses Examples are not interpreted #1785

younss opened this issue Jun 12, 2018 · 3 comments

Comments

@younss
Copy link

younss commented Jun 12, 2018

Hello,
When you copy past an OpenAPI definition with response examples inside the Swagger editor
Example : https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/api-with-examples.yaml

The examples are not interpreted and shown in the UI.

responses:
        '200':
          description: |-
            200 response
          content:
            application/json:
            examples: 
              foo:

It works when you move examples to the Response code level

responses:
        '200':
          description: |-
            200 response
          examples: 
             foo:

Can you Advice please
Regards

@shockey
Copy link
Contributor

shockey commented Jun 12, 2018

This is an artifact from Swagger 2.0 having examples at the code level - you should not rely on it in OpenAPI 3.0.

@younss
Copy link
Author

younss commented Jun 12, 2018

@shockey Thanks of the quick answer.
Of course I don't but do you confirm that there is a bug for supporting OpenAPI example inside Swagger Editor?
Regards

@shockey
Copy link
Contributor

shockey commented Jun 12, 2018

@younss, yes, this is an unimplemented feature in Swagger UI: see swagger-api/swagger-ui#3437 for updates about it 😄

@shockey shockey closed this as completed Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants