-
Notifications
You must be signed in to change notification settings - Fork 331
Add discriminator support for #35 #390
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
Conversation
696db1c
to
f59d413
Compare
@FWiesner I looked into the implementation and haven't gone through the details on the OneOfValidator for all the logic yet. One thing that I want to point out is we might not need to create a new spec version OPENAPI_V3_0_3. The OpenAPI validator can use either V7 or V201909 for the validation. Is there any reason you want to create a new spec version? Thanks. |
well, this was just an idea. I've converted to the feature flag approach
you mentioned yesterday and will push a new commit with it today
Am Mi., 24. März 2021 um 02:17 Uhr schrieb Steve Hu <
***@***.***>:
… @FWiesner <https://github.com/FWiesner> I looked into the implementation
and haven't gone through the details on the OneOfValidator for all the
logic yet. One thing that I want to point out is we might not need to
create a new spec version OPENAPI_V3_0_3. The OpenAPI validator can use
either V7 or V201909 for the validation. Is there any reason you want to
create a new spec version? Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#390 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK6BBPCMC57WABE5HMQILDTFE4THANCNFSM4ZV5BHBA>
.
|
53adf9d
to
86c9923
Compare
86c9923
to
b23e2b5
Compare
} | ||
} | ||
allErrors.addAll(errors); | ||
// allErrors.add(renderMissingMatchValidationMessage(at)); |
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.
@stevehu I wonder whether we can comment this line in - see the log renderer at the end of the file. At the moment failed anyOf
validation doesn't give you an indication that no schema matched
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.
We have an issue opened to add more context information to the error messages to ensure they are understandable. If I am correct, the commented line will add an extra error message with more detailed info. Do you think it would be better to change the errors.add(buildValidationMessage(at, DISCRIMINATOR_REMARK));
with the context info?
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.
that code line will specifically log an additional line saying that none of the candidates matched. Richer context is certainly nice and might make my commented line obsolete. The question just is when that will come and whether then we could simply remove the line again.
Btw I've commented the line as it has impact on test conditions on bunch of tests
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.
OK. Let's leave it this way for now. We need to resolve this issue in one shot for all validators.
the implementation has two limitations: Schema:
properties:
foo:
type: string
required: ["foo"]
allOf:
- $ref: "#/components/schemas/ExtensionBaseWithDiscriminator"
- type: object
properties:
bar:
type: string
required: ["bar"] should ignore |
@FWiesner I think the limitations are OK for now as there is still something in discussion from the spec team. Could you please write a small document on how to use the new feature. I am sure a lot of people will start using it after upgrading to the latest specification. Thanks. |
Sure. What format? |
We have a doc folder and all files are in markdown format and there is a link from the README.md to each feature. |
1.0.51 is released. Thanks for your help. |
Thanks Steve. I’m on vacation until tomorrow. Will send a doc file Thursday
Steve Hu ***@***.***> schrieb am Di. 30. März 2021 um 17:46:
… 1.0.51 is released. Thanks for your help.
https://github.com/networknt/json-schema-validator/releases/tag/1.0.51
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#390 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK6BBOBA75HPT2D644WYYLTGHW5NANCNFSM4ZV5BHBA>
.
|
Attempt to implement #35 for
anyOf
andallOf