fork of hey-api/openapi-ts because I need some additional things
1openapi: 3.0.3
2info:
3 title: OpenAPI 3.0.3 discriminator all of example
4 version: 1
5components:
6 schemas:
7 Foo:
8 type: object
9 required:
10 - id
11 properties:
12 id:
13 type: string
14 discriminator:
15 propertyName: id
16 Bar:
17 allOf:
18 - $ref: '#/components/schemas/Foo'
19 - type: object
20 properties:
21 bar:
22 type: string
23 Baz:
24 allOf:
25 - $ref: '#/components/schemas/Foo'
26 - type: object
27 properties:
28 baz:
29 type: string
30 Qux:
31 allOf:
32 - $ref: '#/components/schemas/Foo'
33 - type: object
34 properties:
35 qux:
36 type: boolean
37 FooMapped:
38 type: object
39 required:
40 - id
41 properties:
42 id:
43 type: string
44 discriminator:
45 propertyName: id
46 mapping:
47 bar: '#/components/schemas/BarMapped'
48 baz: '#/components/schemas/BazMapped'
49 BarMapped:
50 allOf:
51 - $ref: '#/components/schemas/FooMapped'
52 - type: object
53 properties:
54 bar:
55 type: string
56 BazMapped:
57 allOf:
58 - $ref: '#/components/schemas/FooMapped'
59 - type: object
60 properties:
61 baz:
62 type: string
63 QuxMapped:
64 allOf:
65 - $ref: '#/components/schemas/FooMapped'
66 - type: object
67 properties:
68 qux:
69 type: boolean
70 FooUnion:
71 oneOf:
72 - $ref: '#/components/schemas/BarUnion'
73 - $ref: '#/components/schemas/BazUnion'
74 discriminator:
75 propertyName: id
76 mapping:
77 bar: '#/components/schemas/BarUnion'
78 baz: '#/components/schemas/BazUnion'
79 BarUnion:
80 type: object
81 properties:
82 id:
83 type: string
84 bar:
85 type: string
86 BazUnion:
87 type: object
88 properties:
89 id:
90 type: string
91 baz:
92 type: string
93 QuxExtend: # this is a schema that extends the FooUnion schema
94 allOf:
95 - $ref: '#/components/schemas/FooUnion'