Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add oneOf to the schema #48

Open
yeshwanthPentakota opened this issue Jun 2, 2024 · 0 comments
Open

How to add oneOf to the schema #48

yeshwanthPentakota opened this issue Jun 2, 2024 · 0 comments

Comments

@yeshwanthPentakota
Copy link

yeshwanthPentakota commented Jun 2, 2024

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant