json-schema-diff icon indicating copy to clipboard operation
json-schema-diff copied to clipboard

objects inside `anyOf` v.s. multiple types inside object

Open 6293 opened this issue 2 years ago • 0 comments

https://github.com/getsentry/json-schema-diff/pull/20#issuecomment-1540131938


This is a completely unrealistic schema (I hope), but I'm just curious, do you think it is possible to handle this case and produce no diff?

        let lhs = json! {{
            "anyOf": [
                {"properties": {"foo": {"type": "integer"}}},
                {"properties": {"foo": {"type": "string"}}}
            ]
        }};
        let rhs = json! {{
            "properties": {
                "foo": {
                    "type": ["integer", "string"]
                }
            }
        }};

6293 avatar May 09 '23 14:05 6293