Skip to content

Certain changes to anyOf will change internal sorting and produce huge diffs #26

Closed
@untitaker

Description

@untitaker

Before:

{
    "anyOf": [
        {"properties": {"foo": {}}},
        {"properties": {"type": {"const": "bar"}}}
    ]
}

After:

{
    "anyOf": [
        {
            "title": "replay_recording",
            "type": "object",
            "properties": {"foo": {}}
        },
        {"properties": {"type": {"const": "bar"}}}
    ]
}

Diff:

$ json-schema-diff /tmp/a /tmp/b
{"path":".<anyOf:0>","change":{"PropertyRemove":{"lhs_additional_properties":true,"removed":"foo"}},"is_breaking":false}
{"path":".<anyOf:0>","change":{"PropertyAdd":{"lhs_additional_properties":true,"added":"type"}},"is_breaking":true}
{"path":".<anyOf:1>","change":{"PropertyRemove":{"lhs_additional_properties":true,"removed":"type"}},"is_breaking":false}
{"path":".<anyOf:1>","change":{"PropertyAdd":{"lhs_additional_properties":true,"added":"foo"}},"is_breaking":true}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions