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

Always display the Response Example panel even no explicit example block provided #2303

Open
snowbug opened this issue Dec 29, 2022 · 0 comments
Labels
enhancement New feature or request portal triaged

Comments

@snowbug
Copy link

snowbug commented Dec 29, 2022

Context

If a response does not define an explicit example section, there is no Response Example panel shown. I'd like to see the panel with default example values displayed, much like how the request body shows the example values in Elements, and similar to the behavior of swagger UI.

Essentially what's asked here is to always display Example Response panel, using the data type and example value of each individual field in the response schema.

Current Behavior

No "Response Example" panel displayed unless that response content defines an explicit example block.

Expected Behavior

API spec author does not need to create an example block for each response type, Elements always display the Response Example panel using the schema fields definitions.

Possible Solution(s)

Today if one clicks a schema on the left column, Elements already displays an Example panel using the individual schema field definition. We just need to have the same contents displayed when showing the API endpoints.

One reason that we prefer not to create an explicit example section is such definition is separate from the schema fields, and has the inherited risk of not matching the actual schema when the schema changes.

@snowbug snowbug changed the title Display a default response example from schema fields when no explicit example block provided Always display the Response Example panel even no explicit example block provided Dec 29, 2022
@mnaumanali94 mnaumanali94 added the enhancement New feature or request label Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request portal triaged
Projects
None yet
Development

No branches or pull requests

3 participants