This repository has been archived by the owner on Oct 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoneof.yaml
68 lines (67 loc) · 1.58 KB
/
oneof.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
openapi: 3.0.0
info:
title: issue-998
description: A simple API using oneOf.
version: 1.0.0
x-codegen-config:
java:
apiPackage: 'com.ibm.test'
go:
apiPackage: 'github.ibm.com/CloudEngineering/go-test'
paths:
'/resource':
post:
summary: Create a resource.
description: Creates a resource object.
operationId: createresource
x-codegen-request-body-name: resource
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Resource'
responses:
'201':
description: It worked!!!
content:
'application/json':
schema:
$ref: '#/components/schemas/Resource'
default:
description: Rut Roh!
components:
schemas:
Resource:
properties:
id:
description: The resource id.
type: string
info:
$ref: '#/components/schemas/Info'
required:
- id
Info:
type: object
description: Information about a resource.
oneOf:
- $ref: '#/components/schemas/FooInfo'
- $ref: '#/components/schemas/BarInfo'
FooInfo:
type: object
description: Foo Info.
properties:
foo:
description: The foo of the resource.
type: string
required:
- foo
BarInfo:
type: object
description: Bar Info.
properties:
bar:
description: The bar of the resource.
type: string
required:
- bar