Contributions
Re: Problems adding two examples for a response
In fact with "example" and specifying a list, the yaml validates. example: - ex1 .... - ex2 ..... With "examples" that doesn't validate. In the first item of th list I get "should be an object". Can you share a valid code with more than one example for the response? Thanks.2KViews0likes1CommentProblems adding two examples for a response
Hi, I have an endpoint that can return a response based on two different schemas, which I have on the response with oneOf. I'm trying to add examples of those two payloads to the response of that endpoint, but when I add the second example, I get an error in the YAML. Couldn't find an example for this and not sure if that is possible. IMO is a pretty common use case. This is what I'm trying: responses: '200': description: lots of good stuff here.. content: application/json: schema: oneOf: - $ref: '#/components/schemas/A' - $ref: '#/components/schemas/B' example: # also tried with "examples" first example: value: ... anoter example: value: ...Solved2.1KViews0likes3Comments