Skip to content

Conversation

@gmabey
Copy link

@gmabey gmabey commented Jan 28, 2025

No description provided.

schema.erase(attr);

// special case where we break draft-7 and allow overriding of properties when a $ref is used
// special case where we break draft-7 and allow overriding of properties when a $ref is used <<-- might be out-of-date now that 2020-12 is used
Copy link
Author

Choose a reason for hiding this comment

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

Can someone help me understand the meaning in this comment?

// A class representing a JSON-URI for schemas derived from
// section 8 of JSON Schema: A Media Type for Describing JSON Documents
// draft-wright-json-schema-00
// draft-wright-json-schema-00 <<-- might be incorrect now that 2020-12 is used
Copy link
Author

Choose a reason for hiding this comment

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

same as above

{

extern json draft7_schema_builtin;
extern json draft_2020_12_schema_builtin;
Copy link
Author

Choose a reason for hiding this comment

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

I left this general approach here, because I suspect that the intent is to allow for multiple versions of the schema to be included simultaneously -- and validate against the one indicated by $schema. Is that correct?
If not, then this variable should be renamed to something more generic, like schema_builtin.

"description": "valid definition schema",
"data": {
"definitions": {
"$defs": {
Copy link
Author

Choose a reason for hiding this comment

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

I don't think this is correct; the test is still failing (er, passing when it should fail). Could someone help me understand the structure here better?

Copy link
Contributor

Choose a reason for hiding this comment

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

I have barely stuck my toe into json schema definitions, so it is entirely possible that your question is mostly over my head. But draft 2020-12 allows either definitions or $defs as a keyword. Is that what you were expecting to fail? Because if so, it should, in fact, pass. My PR #338 allows either to pass precisely for this reason.

Copy link
Author

Choose a reason for hiding this comment

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

I think I wrote that comment when I was still trying to get my bearings on stuff.
I think you'll agree that $defs is "correct", which definitions is the backward compatible safety net, no?
At least, according to https://json-schema.org/draft/2020-12/schema

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you'll agree that $defs is "correct", which definitions is the backward compatible safety net, no?

That's the way I read it as well.

"description": "invalid definition schema",
"data": {
"definitions": {
"$defs": {
Copy link
Author

Choose a reason for hiding this comment

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

same as above.

@gmabey
Copy link
Author

gmabey commented Oct 4, 2025

@JohanMabille any comments or helpful hints on this incomplete effort would be appreciated

@pboettch
Copy link
Owner

pboettch commented Oct 5, 2025

Sorry that I didn't reply earlier, but actually I was a little surprised that this PR is for real. Sorry to be that harsh.

Draft 2020-12 contains a lot of changes other than the $ref-change. Just moving/renaming every test and replace draft-7 with 2020-12 does nothing.

Adding submodules for the schema is not really a good idea either. The schema is a standardized thing, it won't change for one version of a draft. I'd rather have a copy of a text-file committed, than carrying submodules of third-party projects with us.

This PR, as it is stands of today, won't be merged. 😞

That said, your initiative to support 2020-12 is very welcome. 😄

This would have to be discussed beforehand. And probably cut in smaller tasks to be done by several people.

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.

3 participants