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

Detect errors on missing schema refs #87

Merged
merged 2 commits into from
Mar 8, 2017
Merged

Conversation

joaosa
Copy link
Contributor

@joaosa joaosa commented Mar 1, 2017

More info here

Add a positive test case and two negative test cases (valid data with invalid schema ref and invalid data with valid schema ref)
@joaosa joaosa changed the title Error on missing schema refs Detect errors on missing schema refs Mar 1, 2017
Copy link
Contributor

@honzajavorek honzajavorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work 🥇

errorMessages: {}

for error, index in result?.errors
for err, index in validationErrors
# need to create the error in case of missing schema errors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be even more verbose with the comment:

# If tv4 meets $ref to a missing schema, it provides
# an "empty" error like this: ['', '': '']

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the comment :)

Reformat tv4's missing schema output to match the expected validation
error format
@honzajavorek
Copy link
Contributor

Thanks! 👍

@honzajavorek honzajavorek merged commit 66782a7 into apiaryio:master Mar 8, 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

Successfully merging this pull request may close these issues.

2 participants