-
-
Save bandantonio/c6047e3ee70c90da013a2f8e6757edb0 to your computer and use it in GitHub Desktop.
Redocly response-contains-property guide
This file contains 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
type: object | |
properties: | |
username: | |
description: User supplied username | |
type: string | |
minLength: 4 | |
example: John78 | |
firstName: | |
description: User first name | |
type: string | |
minLength: 1 | |
example: John | |
lastName: | |
description: User last name | |
type: string | |
minLength: 1 | |
example: Smith | |
email: | |
$ref: ../schemas/Email.yaml |
This file contains 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
type: object | |
properties: | |
username: | |
description: User supplied username | |
type: string | |
minLength: 4 | |
example: John78 | |
firstName: | |
description: User first name | |
type: string | |
minLength: 1 | |
example: John | |
lastName: | |
description: User last name | |
type: string | |
minLength: 1 | |
example: Smith | |
email: | |
$ref: ../schemas/Email.yaml |
This file contains 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
type: object | |
properties: | |
username: | |
description: User supplied username | |
type: string | |
minLength: 4 | |
example: John78 | |
firstName: | |
description: User first name | |
type: string | |
minLength: 1 | |
example: John | |
lastName: | |
description: User last name | |
type: string | |
minLength: 1 | |
example: Smith | |
email: | |
$ref: ../schemas/Email.yaml |
This file contains 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
post: | |
tags: | |
- Tag | |
summary: Operation summary with examples | |
description: | | |
Operation description **markdown**. | |
operationId: postPathItemWithExamples | |
security: | |
- api_key: [] | |
- basic_auth: [] | |
requestBody: | |
content: | |
application/json: | |
schema: | |
$ref: ../components/schemas/Schema.yaml | |
examples: | |
mapName: | |
summary: My first example | |
description: My first example's description. | |
value: | |
stringProperty: tada | |
mapNameDoesNotShowInDocsUnlessSummaryIsNotProvided: | |
value: | |
stringProperty: checkmark | |
description: requestBody description | |
required: true | |
responses: | |
'200': | |
description: OK | |
headers: | |
X-Rate-Limit: | |
description: calls per hour allowed by the user | |
schema: | |
type: integer | |
format: int32 | |
X-Expires-After: | |
$ref: ../components/headers/ExpiresAfter.yaml | |
content: | |
application/json: | |
schema: | |
$ref: ../components/responses/200.yaml | |
'400': | |
$ref: ../components/responses/Problem.yaml |
This file contains 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
post: | |
tags: | |
- Tag | |
summary: Operation summary | |
description: | | |
Operation description **Markdown**. | |
operationId: operationId | |
security: | |
- api_key: [] | |
- basic_auth: [] | |
requestBody: | |
content: | |
application/json: | |
schema: | |
$ref: ../components/schemas/Schema.yaml | |
description: requestBody description | |
required: true | |
responses: | |
'200': | |
description: OK | |
headers: | |
X-Rate-Limit: | |
description: Calls per hour allowed by the user. | |
schema: | |
type: integer | |
format: int32 | |
X-Expires-After: | |
$ref: ../components/headers/ExpiresAfter.yaml | |
content: | |
application/json: | |
schema: | |
$ref: ../components/responses/200.yaml | |
'400': | |
$ref: ../components/responses/Problem.yaml |
This file contains 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
parameters: | |
- name: pretty_print | |
in: query | |
description: Pretty print response | |
schema: | |
type: boolean | |
get: | |
tags: | |
- User | |
summary: Get user by user name | |
description: | | |
Some description of the operation. | |
You can use `Markdown` here. | |
operationId: getUserByName | |
parameters: | |
- name: username | |
in: path | |
description: The name that needs to be fetched | |
required: true | |
schema: | |
type: string | |
- name: with_email | |
in: query | |
description: Filter users without email | |
schema: | |
type: boolean | |
security: | |
- main_auth: | |
- 'read:users' | |
- api_key: [] | |
responses: | |
'200': | |
description: Success | |
content: | |
application/json: | |
schema: | |
$ref: ../components/responses/200.yaml | |
example: | |
username: user1 | |
email: user@example.com | |
'201': | |
description: Created | |
content: | |
application/json: | |
schema: | |
$ref: ../components/responses/201.yaml | |
'202': | |
description: Accepted | |
content: | |
application/json: | |
schema: | |
$ref: ../components/responses/202.yaml | |
'403': | |
description: Forbidden | |
$ref: ../components/responses/Problem.yaml | |
'404': | |
description: User not found | |
$ref: ../components/responses/Problem.yaml | |
put: | |
tags: | |
- User | |
summary: Updated user | |
description: This can only be done by the logged in user. | |
operationId: updateUser | |
parameters: | |
- name: username | |
in: path | |
description: The name that needs to be updated | |
required: true | |
schema: | |
type: string | |
security: | |
- main_auth: | |
- 'write:users' | |
requestBody: | |
content: | |
application/json: | |
schema: | |
$ref: ../components/schemas/User.yaml | |
application/xml: | |
schema: | |
$ref: ../components/schemas/User.yaml | |
description: Updated user object | |
required: true | |
responses: | |
'200': | |
description: OK | |
'400': | |
description: Invalid user supplied | |
$ref: ../components/responses/Problem.yaml | |
'404': | |
description: User not found | |
$ref: ../components/responses/Problem.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment