Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants