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

Default validation fails when it encounters a $ref #29

Open
ialarmedalien opened this issue Sep 3, 2020 · 3 comments
Open

Default validation fails when it encounters a $ref #29

ialarmedalien opened this issue Sep 3, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@ialarmedalien
Copy link
Collaborator

ialarmedalien commented Sep 3, 2020

Stored queries do not currently fill in the default values if they are not supplied as part of the params. Make it so!

ETA: This ticket was originally concerned with populating defaults, but further investigation revealed that the current mechanism for adding defaults (taken from the python-jsonschema repo) does not fetch $refs, so defaults do not get set in some cases.

@jayrbolton jayrbolton added the enhancement New feature or request label Sep 8, 2020
@ialarmedalien
Copy link
Collaborator Author

ialarmedalien commented Sep 8, 2020

I was looking to add default values for array properties, but it doesn't look like the python jsonschema supports it. I have a couple more things to try, but if the json schema doesn't allow it, I'll close this issue.

@ialarmedalien
Copy link
Collaborator Author

ialarmedalien commented Sep 9, 2020

OK, it looks like this is an issue with the way defaults are set, as the validator just blindly checks the subschema to see if there's a default field without first checking whether the subschema is a reference or not. 😖 I have changed the schemas I'm using to avoid the problem but ideally the code could be changed to fix the problem.

@ialarmedalien ialarmedalien changed the title Ensure defaults are filled in for stored queries Default validation fails when it encounters a $ref Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants