-
Notifications
You must be signed in to change notification settings - Fork 32
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
Discriminator support for oneOf schema #18
Conversation
4638960
to
eeba4ae
Compare
Signed-off-by: Pavel Demenkov <[email protected]>
eeba4ae
to
98c0ab6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a first pass, I'll properly review it in the next days
src/main/java/io/vertx/ext/json/schema/common/OneOfValidatorFactory.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Pavel Demenkov <[email protected]>
98c0ab6
to
ffb7182
Compare
Signed-off-by: Pavel Demenkov <[email protected]>
Signed-off-by: Pavel Demenkov <[email protected]>
} | ||
} | ||
|
||
private boolean checkDiscriminator(SchemaInternal schema, Object in) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering, can we place some of this code that parses the original schema in the factory/initialization code more than on the hot path?
You can also reorganize the data structure of the validator to have a map discriminator -> schema. Note that you don't have to use the same validator both for oneOf case and oneOf + discriminator case. Feel free to reach me if you have more questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @dps123
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slinkydeveloper Moved the schema parsing to the validator initializer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please check my comments on #31?
Links to #31 |
# Conflicts: # src/main/java/io/vertx/json/schema/openapi3/OneOfDiscriminatorValidatorFactory.java
Signed-off-by: Pavel Demenkov <[email protected]>
We have deprecated this API and the new one does not uses this code. |
Signed-off-by: Pavel Demenkov [email protected]