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

The SchemaPath of allOf type validation message is wrong? #664

Closed
htdan opened this issue Feb 24, 2023 · 4 comments
Closed

The SchemaPath of allOf type validation message is wrong? #664

htdan opened this issue Feb 24, 2023 · 4 comments

Comments

@htdan
Copy link
Contributor

htdan commented Feb 24, 2023

Just an simple example, when validate empty json with the following schema.

{ "type": "object", "properties": { "name": { "type": "string" } }, "allOf": [ { "required": [ "name" ] } ] }

In the validation message returned, we have the schemaPath "allOf/required". Should it be "#/allOf/0/required".

It seems when generating validation message behind allOf, the schemaPath is always partial and starts from allOf keyword only.

@stevehu
Copy link
Contributor

stevehu commented Feb 24, 2023

We might not trace the element's position in the code. Could you please debug it and submit a PR to fix it?

@htdan
Copy link
Contributor Author

htdan commented Feb 28, 2023

We might not trace the element's position in the code. Could you please debug it and submit a PR to fix it?

Sure, can you give me access to the repo?

@stevehu
Copy link
Contributor

stevehu commented Feb 28, 2023

@htdan You can fork this repo into your org and then submit a PR from your repo. Thanks.

@htdan
Copy link
Contributor Author

htdan commented Mar 1, 2023

PR created @stevehu. Please check

@stevehu stevehu closed this as completed Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants