Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

Add sub schema failures to context for container constraints (oneOf, allOf) #82

Open
matt-allan opened this issue Dec 19, 2016 · 2 comments
Milestone

Comments

@matt-allan
Copy link
Collaborator

When a container constraint like oneOf fails, it just says it failed to match one of the schemas and doesn't explain why.

It would be really helpful if we could include the errors that caused the failure within the oneOf/allOf/anyOf error messages.

We don't want to include all of the errors themselves because that gets really confusing. I.e. If you are validating oneOf and the first one fails but the second one matches, it wouldn't make any sense to include those errors. Instead it should probably get added to the context of the oneOf error.

@itsa-sh
Copy link

itsa-sh commented Jun 25, 2017

I was about to raise this very issue, where can I keep updated with this particular issue?

@matt-allan
Copy link
Collaborator Author

Hello 👋

You can follow this issue; I will close it once the feature is implemented.

We could add a new getter to retrieve the sub schema errors in a minor version but changing the context and array representation of the error would have to wait until 2.0.

@matt-allan matt-allan added this to the 2.0 milestone Jun 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants