mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-23 13:30:32 +03:00
Add demo to show capability of oneOf attribute
This commit is contained in:
parent
074872b7ee
commit
133f1ab77d
|
@ -292,6 +292,76 @@ paths:
|
|||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
'/pet/{petId}/behaviors':
|
||||
put:
|
||||
tags:
|
||||
- pet
|
||||
summary: Change behaviors
|
||||
description: Update the pet's behaviors
|
||||
operationId: updateBehavior
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: petId
|
||||
in: path
|
||||
description: ID of pet to return
|
||||
required: true
|
||||
type: integer
|
||||
format: int64
|
||||
- name: body
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
oneOf:
|
||||
- $ref: "#/definitions/CatBehavior"
|
||||
- $ref: "#/definitions/DogBehavior"
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
schema:
|
||||
$ref: '#/definitions/Pet'
|
||||
'400':
|
||||
description: Invalid ID supplied
|
||||
'404':
|
||||
description: Pet not found
|
||||
security:
|
||||
- api_key: []
|
||||
post:
|
||||
tags:
|
||||
- pet
|
||||
summary: Updates a pet in the store with form data
|
||||
description: ''
|
||||
operationId: updatePetWithForm
|
||||
consumes:
|
||||
- application/x-www-form-urlencoded
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: petId
|
||||
in: path
|
||||
description: ID of pet that needs to be updated
|
||||
required: true
|
||||
type: integer
|
||||
format: int64
|
||||
- name: name
|
||||
in: formData
|
||||
description: Updated name of the pet
|
||||
required: false
|
||||
type: string
|
||||
- name: status
|
||||
in: formData
|
||||
description: Updated status of the pet
|
||||
required: false
|
||||
type: string
|
||||
responses:
|
||||
'405':
|
||||
description: Invalid input
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
/pet/findByStatus:
|
||||
get:
|
||||
tags:
|
||||
|
@ -653,12 +723,34 @@ definitions:
|
|||
type: string
|
||||
message:
|
||||
type: string
|
||||
|
||||
CatBehavior:
|
||||
type: object
|
||||
properties:
|
||||
mainTrait:
|
||||
type: string
|
||||
enum:
|
||||
- cuddly
|
||||
- aggressive
|
||||
- lazy
|
||||
|
||||
dangerous:
|
||||
type: boolean
|
||||
|
||||
|
||||
Cat:
|
||||
description: A representation of a cat
|
||||
allOf:
|
||||
- $ref: '#/definitions/Pet'
|
||||
- type: object
|
||||
properties:
|
||||
behaviors:
|
||||
type: array
|
||||
default: []
|
||||
description: A list of behaviors for this Cat
|
||||
items:
|
||||
$ref: "#/definitions/CatBehavior"
|
||||
|
||||
huntingSkill:
|
||||
type: string
|
||||
description: The measured skill for hunting
|
||||
|
@ -668,6 +760,7 @@ definitions:
|
|||
- lazy
|
||||
- adventurous
|
||||
- aggressive
|
||||
|
||||
required:
|
||||
- huntingSkill
|
||||
Category:
|
||||
|
@ -690,12 +783,32 @@ definitions:
|
|||
description: Dumb Property
|
||||
xml:
|
||||
name: Category
|
||||
|
||||
DogBehavior:
|
||||
type: object
|
||||
properties:
|
||||
mainTrait:
|
||||
type: string
|
||||
enum:
|
||||
- noisy
|
||||
- slimy
|
||||
- dependent
|
||||
|
||||
dangerous:
|
||||
type: boolean
|
||||
|
||||
Dog:
|
||||
description: A representation of a dog
|
||||
allOf:
|
||||
- $ref: '#/definitions/Pet'
|
||||
- type: object
|
||||
properties:
|
||||
behaviors:
|
||||
type: array
|
||||
default: []
|
||||
description: A list of behaviors for this Dog
|
||||
items:
|
||||
$ref: "#/definitions/DogBehavior"
|
||||
packSize:
|
||||
type: integer
|
||||
format: int32
|
||||
|
|
Loading…
Reference in New Issue
Block a user