Cannot properly rendering responses -> schema -> allOf
See original GitHub issueI have to handle pagination across all GET API’s The common signature is
{
offset: number,
limit: number,
total: number,
result: [
]
}
However “result” contains for each GET different inner object(s) (User, UserProfile, Application, Group, etc.) So, here is sample of two definitions:
definitions:
PaginationHeader:
type: object
properties:
offset:
type: number
limit:
type: number
total:
type: number
User:
type: object
properties:
id:
type: number
name:
type: string
active:
type: boolean
Now in each response I am trying combine PaginationHeader + result Object
responses:
"200":
description: Success
schema:
allOf:
- $ref: '#/definitions/PaginationHeader'
- properties:
result:
type: array
items:
$ref: '#/definitions/User'
No Errors. But in editor I can see undefined, and I can expand result but not RaginationHeader
And UI just empty object
Whats wrong and how can I fix it?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
allOf in $ref schema doesn't render properly #2765 - GitHub
if $ref schema has allOf in it final schema is not rendered correctly. UI shows empty object and renders as string.
Read more >jsonschema - JSON schema allOf - Stack Overflow
I have tried many different variations of structure but none have validated successfully. The input JSON, which should be invalid (but showing ......
Read more >Schema name no longer appears correctly when referenced ...
Schema name no longer appears correctly when referenced in allOf + oneOf - it just shows as the name of the model all...
Read more >OpenAPI Specification v3.0.3 | Introduction, Definitions, & More
The OpenAPI Specification allows combining and extending model definitions using the allOf property of JSON Schema, in effect offering model ...
Read more >oneOf, anyOf, allOf, not - Swagger
Now, to validation. The following JSON object is valid against one of the schemas, so the response body is correct: { ...
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
Hi, Is there anything new on this behavior (a reference to a new ticket for example) ? This problem seems to be still relevant.
Thank you.
OK that’s swagger-editor, which does not use this library. I suggest you open an issue in that project. For swagger-ui, we get what is expected: