Skip to content

[Schema Inaccuracy] Inconsistent type and oneOf in definition of custom property value #7062

Description

@kilahm

Schema Inaccuracy

#/components/schemas/custom-property-value includes an inconsistent type definition for the value field. The type includes array, string, and null while the oneOf only includes string and "array of string". This causes the custom_property_values event with action updated to fail validation when updating a custom property from or to an empty value.

Expected

When using oneOf where each option includes a type constraint, there shouldn't be a type constraint in the base schema. Or at a minimum the options in oneOf and in the list of valid types should match.

Schema as it exists now:

{
  "title": "Custom Property Value",
  "description": "Custom property name and associated value",
  "type": "object",
  "properties": {
    "property_name": {
      "type": "string",
      "description": "The name of the property"
    },
    "value": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "The value assigned to the property",
      "type": [
        "null",
        "string",
        "array"
      ]
    }
  },
  "required": [
    "property_name",
    "value"
  ]
}

Desired schema:

{
  "title": "Custom Property Value",
  "description": "Custom property name and associated value",
  "type": "object",
  "properties": {
    "property_name": {
      "type": "string",
      "description": "The name of the property"
    },
    "value": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "The value assigned to the property"
    }
  },
  "required": [
    "property_name",
    "value"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions