Example responses and error cases aren't consistent across endpoints, and it would be good to have some sort of standardized layout for them.
Instead of relying on manual reviews to enforce some kind of structure we could build a custom component (similar to api-param) for responses that renders consistent layouts.
Possible approach:
- New
responses array in the meta section
- Each response has a type -
example (for URL + body + response body) or error (for status code + body + explanation)
Open questions:
- If the content is defined in yaml, how can we handle special formatting inside the content, e.g. code or links in explanations?
Example responses and error cases aren't consistent across endpoints, and it would be good to have some sort of standardized layout for them.
Instead of relying on manual reviews to enforce some kind of structure we could build a custom component (similar to
api-param) for responses that renders consistent layouts.Possible approach:
responsesarray in the meta sectionexample(for URL + body + response body) orerror(for status code + body + explanation)Open questions: