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

Cannot add additional properties to schema #5355

Open
mmmmillar opened this issue Oct 16, 2024 · 1 comment
Open

Cannot add additional properties to schema #5355

mmmmillar opened this issue Oct 16, 2024 · 1 comment

Comments

@mmmmillar
Copy link

mmmmillar commented Oct 16, 2024

Old:

{
  "$id": "https://schemas.x.com/x.json",
  "$schema": "http://json-schema.org/draft-07/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    }
  },
  "required": [
    "id"
  ]
}

New:

{
  "$id": "https://schemas.x.com/x.json",
  "$schema": "http://json-schema.org/draft-07/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
   "new_prop": {
      "type": "integer"
    }
  },
  "required": [
    "id"
  ]
}

I have Global Rules set as following:

Screenshot 2024-10-16 at 16 57 52

Both old and new schemas should allow this input (as new_prop is not required) so I think BACKWARD should be supported:

{
	"id": 1,
        "new_prop": 2
}

When I try update I get the following:

{
    "causes": [
        {
            "description": "OBJECT_TYPE_PROPERTY_SCHEMAS_NARROWED",
            "context": "/propertySchemasAdded"
        }
    ],
    "detail": "RuleViolationException: Incompatible artifact: ac3442c0-4314-4770-92b2-5b33c73f0341 [JSON], num of incompatible diffs: {1}, list of diff types: [OBJECT_TYPE_PROPERTY_SCHEMAS_NARROWED at /propertySchemasAdded] Causes: OBJECT_TYPE_PROPERTY_SCHEMAS_NARROWED at /propertySchemasAdded",
    "title": "Incompatible artifact: ac3442c0-4314-4770-92b2-5b33c73f0341 [JSON], num of incompatible diffs: {1}, list of diff types: [OBJECT_TYPE_PROPERTY_SCHEMAS_NARROWED at /propertySchemasAdded] Causes: OBJECT_TYPE_PROPERTY_SCHEMAS_NARROWED at /propertySchemasAdded",
    "status": 409,
    "name": "RuleViolationException"
}
@mmmmillar
Copy link
Author

Error looks like it could be related to #1444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

3 participants