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

Discriminator support for oneOf schema #18

Closed
wants to merge 8 commits into from

Conversation

dps123
Copy link

@dps123 dps123 commented Sep 22, 2020

Signed-off-by: Pavel Demenkov [email protected]

Copy link
Member

@slinkydeveloper slinkydeveloper left a 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

Signed-off-by: Pavel Demenkov <[email protected]>
Signed-off-by: Pavel Demenkov <[email protected]>
}
}

private boolean checkDiscriminator(SchemaInternal schema, Object in) {
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

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

ping @dps123

Copy link
Author

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

Copy link
Member

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?

@slinkydeveloper
Copy link
Member

Links to #31

# Conflicts:
#	src/main/java/io/vertx/json/schema/openapi3/OneOfDiscriminatorValidatorFactory.java
@pk-work
Copy link
Contributor

pk-work commented May 24, 2023

We have deprecated this API and the new one does not uses this code.

@pk-work pk-work closed this May 24, 2023
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.

4 participants