Skip to content

How to add oneOf to the schema #48

@yeshwanthPentakota

Description

@yeshwanthPentakota

type Response struct {
field1 *string json:"field1,omitempty"
field2 *string json:"field2,omitempty"
}

I want to indicate that the response will either contain field1 or field2

Sample spec:

    Response:
      oneOf:
        - $ref: '#/components/schemas/Response1'
        - $ref: '#/components/schemas/Response2'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions