getsentry / json-schema-diff

Diff changes between JSON schemas
https://docs.rs/json-schema-diff/
16 stars 3 forks source link

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

Open 6293 opened 1 year ago

6293 commented 1 year ago

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