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

Validation inconsistencies for overridden properties for referenced schemas. #875

Closed
ajmalrahman opened this issue Oct 12, 2023 · 1 comment

Comments

@ajmalrahman
Copy link

ajmalrahman commented Oct 12, 2023

I have the following schema (internal-msg.yaml) that I use to validate using the json-schema-validator :

{
   "title":"InternalMessage",
   "type":"object",
   "allOf":[
      {
         "$ref":"public-msg.yaml"
      },
      {
         "properties":{
            "id":{
               "readOnly":false
            },
            "status":{
               "type":"boolean"
            }
         },
         "required":[
            "id",
            "status"
         ]
      }
   ]
}

The public-msg.yaml also has the field id that I wanted to override in my internal-msg.yaml. And when loading the schema (as pasted above) - it does seem like it is overridden.

But when I try to validate the json that has the id against the schema, it still does not expect an ID there and complains that it is a readOnly property that cannot be changed.

Why is this happening? I think the schema definition is correct, so probably the validator is not handling the overrides correctly?

@stevehu
Copy link
Contributor

stevehu commented May 30, 2024

Close as there is no activity.

@stevehu stevehu closed this as completed May 30, 2024
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

No branches or pull requests

2 participants