Created
June 18, 2020 14:54
-
-
Save bonii-xx/1d48dd6d8e624aa3689cbb062ac2a7d2 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: | |
title: multi-content-type-schema | |
description: Use different schemas for different content types on the same endpoint | |
version: '1.0' | |
paths: | |
/foobar: | |
post: | |
responses: | |
'200': | |
description: OK | |
operationId: testEndpoint | |
requestBody: | |
description: Form key-value pairs | |
content: | |
application/x.foo+json: | |
schema: | |
$ref: '#/components/schemas/BodyA' | |
application/x.bar+json: | |
schema: | |
$ref: '#/components/schemas/BodyB' | |
components: | |
schemas: | |
BodyA: | |
properties: | |
foo: | |
type: string | |
BodyB: | |
properties: | |
bar: | |
type: string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment