You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found a few problems with the way the validator tool checks $ref usage using version 0.2.1.
I've created and attached a set of example files in example.zip which demonstrates the problems, unzip and run for vi.yaml.
The checking does not apply consistently across all types - in my example vi.yaml errors are given only for headers, parameters and responses despite the blacklist including requestBodies which I reference in the same way.
The format checking is applied to $ref usages within the components object itself, which doesn't make sense because it encourages a spec writer to create a circular reference.
Based on point 3 I think removing the $ref format checks entirely for OpenAPI v3 could be a good solution.
Another option would be to workaround by adding an option to disable the walker's $ref checks, similarly to how many of the other checks can be flagged on and off.
I'd be happy to try and do a PR for either of those options if it suits, just let me know.
Even if I did that though I think further may be needed to address point 1 to get complete spec checking - I haven't looked into why the validator doesn't behave the same way for all the $refs and whether it is missing validating part of the tree.
The text was updated successfully, but these errors were encountered:
I've found a few problems with the way the validator tool checks
$ref
usage using version0.2.1
.I've created and attached a set of example files in example.zip which demonstrates the problems, unzip and run for
vi.yaml
.vi.yaml
errors are given only forheaders
,parameters
andresponses
despite the blacklist includingrequestBodies
which I reference in the same way.$ref
usages within the components object itself, which doesn't make sense because it encourages a spec writer to create a circular reference.$ref
format in OpenAPI v3 are invalid anyway. I sought clarification on this in Clarify statement aboutReference obects
inResponses object
OAI/OpenAPI-Specification#1679 - though the spec has not been updated yet (as of v3.0.2).Based on point 3 I think removing the
$ref
format checks entirely for OpenAPI v3 could be a good solution.Another option would be to workaround by adding an option to disable the walker's
$ref
checks, similarly to how many of the other checks can be flagged on and off.I'd be happy to try and do a PR for either of those options if it suits, just let me know.
Even if I did that though I think further may be needed to address point 1 to get complete spec checking - I haven't looked into why the validator doesn't behave the same way for all the
$ref
s and whether it is missing validating part of the tree.The text was updated successfully, but these errors were encountered: