Skip to content

oneOf does not Display Correctly When In an Array #2852

@kentbulza

Description

@kentbulza

Given the following schema for a theoretical request/response body:

{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "myArray": { "type": "array", "items": { "type": "object", "properties": { "identifier": { "type": "string", "description": "The identifier string.", "examples": ["123-45-6789"], "minLength": 1, "maxLength": 100 }, "assigner": { "type": "string", "description": "Identifier assigner.", "oneOf": [ { "enum": ["INTERNAL"], "examples":["INTERNAL"], "readOnly": true, "description": "INTERNAL identifiers are system generated. You cannot assign these." }, { "enum": ["EXTERNAL"], "examples":["EXTERNAL"], "description": "EXTERNAL identifiers are assigned by you." } ] }, "type": { "type": "string", "description": "The type of identifier.", "enum": ["SSN", "UUID", "INTEGER"], "examples": ["SSN"] } }, "identifier": ["id", "type", "authority"], "minProperties": 1, "description": "You must assign at least one identifier." }, "minItems": 1, "description": "Array of identifiers." } }, "required": ["myArray"] }

For property assigner, the enumeration value (or constant -- I tried both) does not display, nor do the example values, nor the read-only flag. The oneOf dropdown does work. assigner should look identical to the type enumeration below it, with a read-only flag displaying on the first "oneOf" -- it just happens to be inside of a oneOf:

First "oneOf" selected:

Image

Second "oneOf" selected:

Image

The read-only flag should display as shown below for a non-"oneOf" property:

Image

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