Skip to content

Missing array description that is nested under under anyOf #2639

Open
@R2RT

Description

@R2RT

Describe the bug

When array type is nested under anyOf it is rendered in quite a raw state, no description is shown at all.

Expected behavior

Description of currently selected array should be visible.

Minimal reproducible OpenAPI snippet(if possible)

Api file:
api.json

Generated with Python script
from fastapi import FastAPI
import json
from typing import Annotated
from pydantic import RootModel, Field


class Euler3(RootModel[Annotated[list[float], Field(min_length=3, max_length=3)]]):
    """Euler angles in degrees"""


class Quaternion(RootModel[Annotated[list[float], Field(min_length=4, max_length=4)]]):
    """Orientation defined by quaternion XYZW. It should be normalized."""


class Rotation(RootModel[Euler3 | Quaternion]):
    """Rotation in 3D world"""


app = FastAPI(
    title="Test",
)


@app.post("/rotation")
async def rotation(r: Rotation) -> Rotation:
    return Rotation


schema = app.openapi()


if __name__ == "__main__":
    import sys

    json.dump(app.openapi(), sys.stdout)

Screenshots

ReDoc view generated by https://redocly.github.io/redoc/:

Image

For reference, view generated with swagger keeps the descriptions: https://editor.swagger.io/

Image

Additional context

I've tried with explicit hideOneOfDescription = false, no change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions