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

Better advertising of $ref sibling issues #52

Open
3 tasks
fredbi opened this issue Jan 2, 2018 · 2 comments
Open
3 tasks

Better advertising of $ref sibling issues #52

fredbi opened this issue Jan 2, 2018 · 2 comments

Comments

@fredbi
Copy link
Member

fredbi commented Jan 2, 2018

When writing yaml specs, indentation does matter.

It is vey easy to mismatch a $ref into a sibling object.

In that case, the parser overrides the schema by the $ref, which is correct behavior.

Often, valid vs invalid differ by only a few blanks.

Currently, the validator follows the parsed schema. Most likely, we get some difficult to understand errors such as 'xxx in body does not validate OneOf()' ... I found very frustrating to plow specs for hours to eventually figure out the problem.

Todo:

  • A warning should be issued when $ref have sibling properties in schema.
  • Similarly, $ref in inappropriate places according to swagger spec (not json schema) should be advertised as errors
  • The previous line has been patched for the special case of headers by PR#44. This work around introduced a small bug, in the case the user spec's contains a "header" property with a "$ref" inside
@alexstojda
Copy link

@fredbi any progress on this?

@fredbi
Copy link
Member Author

fredbi commented Nov 1, 2018

no I've very much busy patching up some other sides of go-openapi

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

No branches or pull requests

2 participants