Created
February 22, 2024 16:51
-
-
Save david0/1b3d159b4e951e1a589fac596e9a0488 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: "3.0.0" | |
info: | |
version: 1.0.0 | |
title: OneOf example | |
paths: | |
/search: | |
post: | |
requestBody: | |
content: | |
application/json: | |
schema: | |
$ref: "#/components/schemas/Filter" | |
responses: | |
'200': | |
description: Expected response to a valid request | |
content: | |
application/json: | |
schema: | |
type: object | |
components: | |
schemas: | |
Username: | |
type: object | |
properties: | |
username: | |
type: string | |
required: | |
- username | |
AccountNumber: | |
type: object | |
properties: | |
accountNumber: | |
type: string | |
required: | |
- accountNumber | |
Filter: | |
oneOf: | |
- $ref: "#/components/schemas/Username" | |
- $ref: "#/components/schemas/AccountNumber" | |
type: object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment