OAS 3: Flasgger seems not being able to resolve *components* reference when using yml file
See original GitHub issueUsing an external yml file, even if adding as suggested app['SWAGGER']['openapi'] = '3.0.2'
,
it seems not being able to resolve the #/schemas/components reference:
My API is awesome......
---
tags:
- My API
post:
parameters:
- name: user-id
in: header
description: Id of the user
type: string
required: true
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Users'
responses:
200:
description: something.
content:
application/json:
schema:
$ref: '#/components/schemas/UserData'
components:
schemas:
Users:
type: object
properties:
property1:
type: string
UserData:
type: object
properties:
property2:
type: string
.........
...............
..............
on the Swagger page i get:
Errors
Hide
Resolver error at paths./v1/notifications/compute.post.responses.200.content.application/json.schema.$ref
Could not resolve reference because of: Could not resolve pointer: /components/schemas/UserData does not exist in document
the schema referred by $ref: '#/components/schemas/Users'
is not shown at all and no errors are visualized for this
I can’t type properly the tabs on here, but the indentation is ok on my side.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
OAS 3: Flasgger seems not being able to resolve ... - GitHub
OAS 3 : Flasgger seems not being able to resolve *components* reference when using yml file #308. Open. vitodsk opened this issue on...
Read more >OAS 3: Flasgger seems not being able to resolve *components ...
OAS 3 : Flasgger seems not being able to resolve *components* reference when using yml file.
Read more >openAPI unable to resolve ref to external file. Component ...
My mistake was in thinking that the Map contained either a key, value pair of string, Schema Object or a Reference Object that...
Read more >Splitting specification file - API Handyman
In part 3 - Simplifying spefication file we have learned how to simplify the specification by creating reusable elements.
Read more >Adding Examples - Swagger
OAS 2 This page applies to OpenAPI Specification ver. 2 (fka Swagger). ... Note: Do not confuse example values with the default values....
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
Not working here as well ☹️
I’ll leave some information below, but LMK if there’s anything else I could provide you, or do for you, in order to further assist in the resolution of this issue 😄
Flasgger version: 0.9.5
Here are the relevant parts of code which include flasgger 👇
OpenAPI Specification yaml…
response 400
(which usescomponents
) does NOT work, while theresponse 500
(which has the same specification as the 400 one and doesn’t usecomponents
) works. Also, to be clear, I tried some variations of the code below. 👇Output 👇
Error 👇
Is this solved? I had a same problem and ‘optional_fields’ is not working.