Skip to content

issue oneOf with same property name and different definitions #133

@LukasGoTom

Description

@LukasGoTom

i will add hopefully with test case to reproduce, just claiming the issue number for now

problem schema

{
  "type": "object",
  "properties": {
    "committed_metrics": {
      "type": "array",
      "items": {
        "type": "object",
        "discriminator": {
          "propertyName": "scope"
        },
        "oneOf": [
          {
            "properties": {
              "scope": {
                "type": "string",
                "const": "vendor"
              },
              "metric_id": {
                "enum": [
                  "impressions",
                  "spend",
                  "clicks",
                  "ctr"
                ]
              }
            },
            "required": [
              "scope",
              "metric_id"
            ]
          },
          {
            "properties": {
              "scope": {
                "type": "string",
                "const": "standard"
              },
              "metric_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[a-z][a-z0-9_]*$"
              }
            },
            "required": [
              "scope",
              "metric_id"
            ]
          }
        ]
      },
      "minItems": 1
    }
  },
  "required": [
    "committed_metrics"
  ]
}



Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions