Response example not rendering
See original GitHub issueResponse example not rendering
Response object is not rendering when configured as sister of schema and deletes properties when configured as daughter of schema
Q | A |
---|---|
Bug or feature request? | Bug |
Which Swagger/OpenAPI version? | 3.X |
Which Swagger-UI version? | 3.4.0 |
How did you install Swagger-UI? | github |
Which browser & version? | Chrome 62 |
Which operating system? | Ubuntu 64 |
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
responses:
200:
description: OK
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Response'
- type: object
properties:
results:
type: array
items:
type: object
$ref: '#/components/schemas/Detection'
example:
count: 10
next: "http://127.0.0.1/api/v2/detection?page=3&page_size=1"
previous: "http://127.0.0.1/api/v2/detection?page=1&page_size=1"
When I move example to a daughter of schema, I get he substitution, but lose additional properties that were appended to the schema
responses:
200:
description: OK
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Response'
- type: object
properties:
results:
type: array
items:
type: object
$ref: '#/components/schemas/Detection'
example:
count: 10
next: "http://127.0.0.1/api/v2/detection?page=3&page_size=1"
previous: "http://127.0.0.1/api/v2/detection?page=1&page_size=1"
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Express - Do not render POST response - Stack Overflow
I have a basic Express API: app.get('/example', ...
Read more >Suspense for Data Fetching (Experimental) - React
Approach 1: Fetch-on-Render (not using Suspense) ... they can render. In this example, two components wait for an asynchronous API call to fetch...
Read more >DataTable Not Rendering Rows Even Though JSON ...
I'm implementing a DataTable that makes an AJAX call. Per the Chrome browser F12 console, it's receiving the correct JSON response but not...
Read more >Renderers - Django REST framework
Renders data to HTML, using Django's standard template rendering. Unlike other renderers, the data passed to the Response does not need to be...
Read more >API Reference - Express 4.x
toString() may fail in multiple ways, for example foo may not be there or may not be a ... When a file is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@keenle support for OAS3 media type examples is being tracked in #2651.
Closing as a duplicate of #2651