@@ -243,6 +243,76 @@ paths:
243243 items :
244244 $ref : " #/components/schemas/Book"
245245
246+ /allof-with-properties-in-array-item :
247+ get :
248+ tags :
249+ - allOf
250+ summary : allOf with Properties in Array Item
251+ description : |
252+ A list of books demonstrating allOf with properties in array item.
253+
254+ Schema:
255+ ```yaml
256+ type: array
257+ items:
258+ $ref: '#/components/schemas/Book'
259+ ```
260+
261+ Schema Components:
262+ ```yaml
263+ BookBase:
264+ type: object
265+ required:
266+ - id
267+ - title
268+ - author
269+ properties:
270+ id:
271+ type: integer
272+ format: int64
273+ description: Unique identifier for the book
274+ title:
275+ type: string
276+ description: The title of the book
277+ author:
278+ type: string
279+ description: The author of the book
280+
281+ AdditionalBookInfo:
282+ type: object
283+ properties:
284+ publishedDate:
285+ type: string
286+ format: date
287+ description: The date the book was published
288+ genre:
289+ type: string
290+ description: The genre of the book
291+ tags:
292+ type: array
293+ items:
294+ type: string
295+ description: Tags associated with the book
296+
297+ CategorizedBook:
298+ allOf:
299+ - $ref: '#/components/schemas/BookBase'
300+ - $ref: '#/components/schemas/AdditionalBookInfo'
301+ properties:
302+ category:
303+ type: string
304+ description: The category of the book
305+ ```
306+ responses :
307+ " 200 " :
308+ description : A list of books
309+ content :
310+ application/json :
311+ schema :
312+ type : array
313+ items :
314+ $ref : " #/components/schemas/CategorizedBook"
315+
246316 /allof-nested :
247317 get :
248318 tags :
@@ -320,12 +390,15 @@ components:
320390 type : integer
321391 format : int64
322392 description : Unique identifier for the book
393+ example : 1234567890
323394 title :
324395 type : string
325396 description : The title of the book
397+ example : " The Great Gatsby"
326398 author :
327399 type : string
328400 description : The author of the book
401+ example : " F. Scott Fitzgerald"
329402
330403 AdditionalBookInfo :
331404 type : object
@@ -334,16 +407,29 @@ components:
334407 type : string
335408 format : date
336409 description : The date the book was published
410+ example : " 2021-01-01"
337411 genre :
338412 type : string
339413 description : The genre of the book
414+ example : " Fiction"
340415 tags :
341416 type : array
342417 items :
343418 type : string
344419 description : Tags associated with the book
420+ example : ["Fiction", "Mystery"]
345421
346422 Book :
347423 allOf :
348424 - $ref : " #/components/schemas/BookBase"
349425 - $ref : " #/components/schemas/AdditionalBookInfo"
426+
427+ CategorizedBook :
428+ allOf :
429+ - $ref : " #/components/schemas/BookBase"
430+ - $ref : " #/components/schemas/AdditionalBookInfo"
431+ properties :
432+ category :
433+ type : string
434+ description : The category of the book
435+ example : " Fiction"
0 commit comments