Skip to content

filter anyOf and oneOf alternative#180

Open
animeshsahoo1 wants to merge 2 commits intohyperjump-io:mainfrom
animeshsahoo1:filter-anyOf-oneOf-alternatives
Open

filter anyOf and oneOf alternative#180
animeshsahoo1 wants to merge 2 commits intohyperjump-io:mainfrom
animeshsahoo1:filter-anyOf-oneOf-alternatives

Conversation

@animeshsahoo1
Copy link

The anyof and oneof error handlers now filter alternatives based on the instance's properties. For object instances, an alternative is excluded from the error report if none of its declared properties exist on the instance (Rule 1), or if none of the instance's properties pass validation in that alternative (Rule 2). For non-object instances, the original type-keyword filtering is done.

fixes #175

@animeshsahoo1
Copy link
Author

hi @jdesrosiers I have implemented what we discussed about, I tried to not add anything unnecessary but if there is need of changes let me know, I made sure to run the linting and tests as well.

Copy link
Collaborator

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

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

Please add tests. They need to cover all the edge cases we discussed and more if you can think of them.

@animeshsahoo1
Copy link
Author

I did run it on tests we talk about but I was unsure if I had to add the code for that, I will add it soon.

@animeshsahoo1
Copy link
Author

I have added the test case for matchcount=0 for oneOf and anyOf test cases that were discussed, I tried to think of a failing case but didn't really find any let me know if I could add any other test case

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.

Filter anyOf/oneOf object alternative results by the discriminator

2 participants