Skip to content

oneOf with same-shaped array schemas is rendered as oneOf: array[string], losing semantic detailΒ #2860

@RobbredW

Description

@RobbredW

When an OpenAPI 3 schema uses oneOf with multiple array-of-string schemas that differ only by enum, the rendered output collapses to a generic:

oneOf: array[string]

This loses important semantic detail for API consumers, even though the OpenAPI definition is valid.

Example
"adminrights": {"oneOf": [{"type": "array","minItems": 1,"maxItems": 1,"items": {"type": "string","enum": ["full"]}},{"type": "array","items": {"type": "string","enum": ["user","app"]}}]},

Output

Image Image

Expected

The renderer should preserve or expose the distinct oneOf branches (or their enum constraints), instead of flattening them into a generic array type.

Notes

This appears to be a rendering/modeling fallback triggered when oneOf has multiple non-$ref children of identical shape.

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