Skip to content

Validation: Unreadable error message if an error occurs inside a parameter. #598

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

Closed
IvanGoncharov opened this issue Mar 17, 2016 · 2 comments

Comments

@IvanGoncharov
Copy link
Contributor

JSON Schema for 2.0 to validate method parameter use two oneOf one inside each other.
This leads to an unreadable error message if an error occurs inside a parameter.
And it's true for all tools which are use official JSON Schema for validation.
I used Swagger Editor as example of such behaviour:
selection_026

I think it's very important issue since it can push away newcomers who just want to try OpenAPI 2.0 for the first time.

I have a solution for this problem which requires making few changes in current JSON Schema.
As a nice bonus, it reduces duplication in parameters definitions and overall size of JSON Schema.

But before submitting such changes I want to test them thoroughly.
That is why I want to finish my work on unit test.

@IvanGoncharov
Copy link
Contributor Author

@whitlockjc As an expert on OpenAPI validation can you please provide your feedback.

@webron
Copy link
Member

webron commented Mar 17, 2016

Just submit a PR with the proposed changes. JSON schema validation is unfriendly to users one way or another, but if you think it can be simplified without changing the intent, please do so. We've accepted PRs before, but rejected ones that changed the intent for the sake of readability.

@fehguy fehguy closed this as completed Feb 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants