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

[schema] Validate that type name is a string #429

Merged
merged 1 commit into from
Dec 15, 2017
Merged

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented Dec 15, 2017

If you have an error in your schema where a type-field is a non-string, the schema validation will fail when trying to figure out the closest match to it it with a levenshtein distance comparator.

This adds an additional step ensuring that the type is a string.

Copy link
Contributor

@thomax thomax left a comment

Choose a reason for hiding this comment

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

LGTM. Though I'm wondering if it would be even more helpful if the current typeName was included in the error message?

@rexxars
Copy link
Member Author

rexxars commented Dec 15, 2017

typeName could be a big object of some kind, so I'm not sure how that would work. Potentially serialize it to JSON and cut out a part of it?

@rexxars
Copy link
Member Author

rexxars commented Dec 15, 2017

The schema validator does include a parent path, however, so it shouldn't be too hard to track down.

@rexxars rexxars merged commit b0736b2 into next Dec 15, 2017
@rexxars rexxars deleted the fix-type-name-validation branch December 15, 2017 13:48
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