-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Response example not rendering #3837
Comments
This is a duplicate of #3437.
This is expected - according to the spec, the Try moving your |
Couple of things:
Hopefully, this makes sense. If there is way I can achieve this through combining references, any help you can provide is greatly appreciated. |
There's no mix and match for examples. If you define an example, it will be used as-is as the value (whether valid or not). You should not expect the UI to use parts of the values from the example and parts generating from the model itself. The only way to set an example value to specific parts of the model is by providing the example at the property level - however, once you define a top-level example it will override the property example, and the property examples would be applied to all places that reference that model. As for creating similar examples but with slightly different values - you'd need to create a whole example for each one of those cases. |
That's fair, I will be happy to define examples for a full schema. The problem I am running into is that my response schema is built from two objects
as soon as I start to configure examples, the reference to the Response renders, but the results object gets dropped completely |
It would really help to see something more full than snippets. |
I am attaching my spec. if you view the spec as configured, you will get the full sample for GET /detections. But, if you uncomment lines 65-69, the example breaks the schema and only renders k/v pairs. |
Going over tickets again now for organization, and upon testing the definition as provided, it seems to behave as expected. It just renders the example as-is, which is what it's supposed to do. |
The problem of not rendered examples for
|
I assume that my previous message describes a bug since OpenAPI spec for Media Type Object says the following:
|
Closing as a duplicate of #2651 |
Response example not rendering
Response object is not rendering when configured as sister of schema and deletes properties when configured as daughter of schema
According to the docs, example should be a sister to schema when using $ref. When doing this, I do not get the substitution I would expect for count, next, and previous
When I move example to a daughter of schema, I get he substitution, but lose additional properties that were appended to the schema
The text was updated successfully, but these errors were encountered: