Closed fgimian closed 6 years ago
In the example that you gave above, #/definitions/User
does not exist, which is why it causes an error. If you meant to reference your definitions/User.yaml
file, then you use a file reference, rather an a JSON Pointer. Like this...
get:
responses:
200:
description: OK
schema:
$ref: 'definitions/User.yaml'
Or, if you prefer to keep all of your definitions in the "definitions" section of your schema, then you can do something like this...
get:
responses:
200:
description: OK
schema:
$ref: '#/definitions/User'
definitions:
User:
$ref: 'definitions/User.yaml'
Hi guys, thanks for your great work on this project.
I noticed that a scenario such as the one shown here fails as this CLI seems to resolve references top to bottom rather than resolving external file references first and then local references second.
The reason this happens is that once the CLI reaches the bar path, it sees:
And it attempts to resolve local ref #/definitions/User' prior to referencing the external definition files.
Any help would be greatly appreciated 😄 Fotis