Skip to content

Cannot add additional properties to schema #5355

Open
@mmmmillar

Description

@mmmmillar

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"
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status

    Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions