Skip to content

Commit 23335ef

Browse files
committed
move test to allOf
1 parent 3aa036d commit 23335ef

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

demo/examples/tests/allOf.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,51 @@ paths:
367367
otherOuterProp:
368368
type: string
369369

370+
/allof-parent-required:
371+
get:
372+
tags:
373+
- allOf
374+
summary: allOf inherits parent required
375+
description: |
376+
Parent object marks the "pet" property as required while its schema is composed via allOf.
377+
378+
Schema:
379+
```yaml
380+
type: object
381+
properties:
382+
pet:
383+
allOf:
384+
- type: object
385+
properties:
386+
name:
387+
type: string
388+
- type: object
389+
properties:
390+
age:
391+
type: integer
392+
required: [pet]
393+
```
394+
responses:
395+
"200":
396+
description: Successful response
397+
content:
398+
application/json:
399+
schema:
400+
type: object
401+
properties:
402+
pet:
403+
allOf:
404+
- type: object
405+
properties:
406+
name:
407+
type: string
408+
- type: object
409+
properties:
410+
age:
411+
type: integer
412+
required:
413+
- pet
414+
370415
components:
371416
schemas:
372417
# Your existing schemas are integrated here.

0 commit comments

Comments
 (0)