Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with $ref format checking #13

Closed
ricellis opened this issue Jan 10, 2019 · 1 comment
Closed

Issues with $ref format checking #13

ricellis opened this issue Jan 10, 2019 · 1 comment
Assignees
Labels

Comments

@ricellis
Copy link
Member

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.

  1. 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.
  2. 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.
  3. The restrictions on the $ref format in OpenAPI v3 are invalid anyway. I sought clarification on this in Clarify statement about Reference obects in Responses 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 $refs and whether it is missing validating part of the tree.

@dpopp07
Copy link
Member

dpopp07 commented Feb 5, 2019

🎉 This issue has been resolved in version 0.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants