1+ openapi : 3.1.0
2+ info :
3+ title : ByRefOrValue
4+ description : >
5+ This tests for a oneOf interface representation
6+ version : 0.0.1
7+ servers :
8+ - url : " http://localhost:8080"
9+ tags :
10+ - name : Foo
11+ - name : Bar
12+ paths :
13+ /foo :
14+ get :
15+ tags :
16+ - Foo
17+ summary : GET all Foos
18+ operationId : getAllFoos
19+ responses :
20+ ' 200 ' :
21+ $ref : ' #/components/responses/200FooArray'
22+ post :
23+ tags :
24+ - Foo
25+ summary : Create a Foo
26+ operationId : createFoo
27+ requestBody :
28+ $ref : ' #/components/requestBodies/Foo'
29+ responses :
30+ ' 201 ' :
31+ $ref : ' #/components/responses/201Foo'
32+ /bar :
33+ post :
34+ tags :
35+ - Bar
36+ summary : Create a Bar
37+ operationId : createBar
38+ requestBody :
39+ required : true
40+ content :
41+ ' application/json ' :
42+ schema :
43+ $ref : ' #/components/schemas/Bar_Create'
44+ responses :
45+ 200 :
46+ description : Bar created
47+ content :
48+ ' application/json ' :
49+ schema :
50+ $ref : ' #/components/schemas/Bar'
51+
52+ components :
53+ schemas :
54+ Addressable :
55+ type : object
56+ properties :
57+ href :
58+ type : string
59+ description : Hyperlink reference
60+ id :
61+ type : string
62+ description : unique identifier
63+ description : Base schema for addressable entities
64+ Extensible :
65+ type : object
66+ properties :
67+ " @schemaLocation " :
68+ type : string
69+ description : A URI to a JSON-Schema file that defines additional attributes
70+ and relationships
71+ " @baseType " :
72+ type : string
73+ description : When sub-classing, this defines the super-class
74+ " @type " :
75+ type : string
76+ description : When sub-classing, this defines the sub-class Extensible name
77+ required :
78+ - ' @type'
79+ Entity :
80+ type : object
81+ discriminator :
82+ propertyName : ' @type'
83+ allOf :
84+ - " $ref " : " #/components/schemas/Addressable"
85+ - " $ref " : " #/components/schemas/Extensible"
86+ EntityRef :
87+ type : object
88+ discriminator :
89+ propertyName : ' @type'
90+ description : Entity reference schema to be use for all entityRef class.
91+ properties :
92+ name :
93+ type : string
94+ description : Name of the related entity.
95+ ' @referredType ' :
96+ type : string
97+ description : The actual type of the target instance when needed for disambiguation.
98+ allOf :
99+ - $ref : ' #/components/schemas/Addressable'
100+ - " $ref " : " #/components/schemas/Extensible"
101+ FooRefOrValue :
102+ type : object
103+ oneOf :
104+ - $ref : " #/components/schemas/Foo"
105+ - $ref : " #/components/schemas/FooRef"
106+ discriminator :
107+ propertyName : " @type"
108+ Foo :
109+ type : object
110+ properties :
111+ fooPropA :
112+ type : string
113+ fooPropB :
114+ type : string
115+ allOf :
116+ - $ref : ' #/components/schemas/Entity'
117+ FooRef :
118+ type : object
119+ properties :
120+ foorefPropA :
121+ type : string
122+ allOf :
123+ - $ref : ' #/components/schemas/EntityRef'
124+ BarRef :
125+ type : object
126+ allOf :
127+ - $ref : ' #/components/schemas/EntityRef'
128+ Bar_Create :
129+ type : object
130+ properties :
131+ barPropA :
132+ type : string
133+ fooPropB :
134+ type : string
135+ foo :
136+ $ref : ' #/components/schemas/FooRefOrValue'
137+ allOf :
138+ - $ref : ' #/components/schemas/Entity'
139+ Bar :
140+ type : object
141+ required :
142+ - id
143+ properties :
144+ id :
145+ type : string
146+ barPropA :
147+ type : string
148+ fooPropB :
149+ type : string
150+ foo :
151+ $ref : ' #/components/schemas/FooRefOrValue'
152+ allOf :
153+ - $ref : ' #/components/schemas/Entity'
154+ BarRefOrValue :
155+ type : object
156+ oneOf :
157+ - $ref : " #/components/schemas/Bar"
158+ - $ref : " #/components/schemas/BarRef"
159+ Pizza :
160+ type : object
161+ properties :
162+ pizzaSize :
163+ type : number
164+ allOf :
165+ - $ref : ' #/components/schemas/Entity'
166+ Pasta :
167+ type : object
168+ properties :
169+ vendor :
170+ type : string
171+ allOf :
172+ - $ref : ' #/components/schemas/Entity'
173+ PizzaSpeziale :
174+ type : object
175+ properties :
176+ toppings :
177+ type : string
178+ allOf :
179+ - $ref : ' #/components/schemas/Pizza'
180+ FruitType :
181+ type : string
182+ enum : [APPLE, BANANA]
183+ Fruit :
184+ type : object
185+ properties :
186+ fruitType :
187+ $ref : " #/components/schemas/FruitType"
188+ description : " test"
189+ required :
190+ - fruitType
191+ oneOf :
192+ - $ref : ' #/components/schemas/Apple'
193+ - $ref : ' #/components/schemas/Banana'
194+ discriminator :
195+ propertyName : fruitType
196+ mapping :
197+ APPLE : ' #/components/schemas/Apple'
198+ BANANA : ' #/components/schemas/Banana'
199+ Apple :
200+ type : object
201+ required :
202+ - seeds
203+ properties :
204+ seeds :
205+ type : integer
206+ Banana :
207+ type : object
208+ required :
209+ - length
210+ properties :
211+ length :
212+ type : integer
213+ Animal :
214+ oneOf :
215+ - $ref : ' #/components/schemas/Dog'
216+ - $ref : ' #/components/schemas/Cat'
217+ Cat :
218+ type : object
219+ properties :
220+ declawed :
221+ type : boolean
222+ Dog :
223+ type : object
224+ properties :
225+ bark :
226+ type : boolean
227+
228+ requestBodies :
229+ Foo :
230+ description : The Foo to be created
231+ content :
232+ application/json;charset=utf-8 :
233+ schema :
234+ $ref : ' #/components/schemas/Foo'
235+
236+ responses :
237+ ' 204 ' :
238+ description : Deleted
239+ content : { }
240+ 201Foo :
241+ description : Error
242+ content :
243+ application/json :
244+ schema :
245+ $ref : ' #/components/schemas/FooRefOrValue'
246+ 200FooArray :
247+ description : Success
248+ content :
249+ application/json;charset=utf-8 :
250+ schema :
251+ type : array
252+ items :
253+ $ref : ' #/components/schemas/FooRefOrValue'
0 commit comments