Skip to content

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

Open

Description

@6293

#20 (comment)


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

Activity

  1. added
    jsonschema-feature
    help wanted
    on May 9, 2023
  2. sidsri14 commented on Jul 24, 2026

    @sidsri14

    I will work on this. I will add a focused regression for the equivalent object schemas, normalize shared object constraints into each top-level anyOf branch for matching, and keep the change scoped to draft-07 behavior already modeled by this crate.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedjsonschema-feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions