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

WIP converting all static strings over to draft 2020-12 #343

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gmabey
Copy link

@gmabey gmabey commented Jan 28, 2025

No description provided.

@@ -1409,7 +1409,7 @@ std::shared_ptr<schema> schema::make(json &schema,

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?

@@ -37,7 +37,7 @@ namespace nlohmann

// 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

@@ -128,7 +128,7 @@ class JSON_SCHEMA_VALIDATOR_API json_uri
namespace json_schema
{

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.

"tests": [
{
"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?

@@ -15,7 +15,7 @@
{
"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.

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.

1 participant