Skip to content

@Schema oneOf config is ignored when generate the api-docs #4732

Open
@abccbaandy

Description

@abccbaandy
    @Schema(oneOf = {Child1.class, Child2.class})
    private Parent obj;

The result is something like this

                    "MyPojo": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/Child1"
                            },
                            {
                                "$ref": "#/components/schemas/Child2"
                            },
                            {
                                "$ref": "#/components/schemas/Child3"
                            }
                        ]
                    },

Seems the result does not come from my config.

Also I think oneOf should take string($ref) instead class?

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