fork of hey-api/openapi-ts because I need some additional things
at main 127 lines 2.9 kB view raw
1openapi: 3.0.4 2info: 3 title: OpenAPI 3.0.4 transforms read write example 4 version: 1 5paths: 6 /foo-read-write: 7 post: 8 requestBody: 9 content: 10 'application/json': 11 schema: 12 $ref: '#/components/schemas/FooReadWrite' 13 required: true 14 responses: 15 '200': 16 content: 17 '*/*': 18 schema: 19 $ref: '#/components/schemas/FooReadWrite' 20 description: OK 21 /foo-read: 22 post: 23 requestBody: 24 content: 25 'application/json': 26 schema: 27 $ref: '#/components/schemas/FooRead' 28 required: true 29 responses: 30 '200': 31 content: 32 '*/*': 33 schema: 34 $ref: '#/components/schemas/FooRead' 35 description: OK 36 /foo-write: 37 post: 38 requestBody: 39 content: 40 'application/json': 41 schema: 42 $ref: '#/components/schemas/FooWrite' 43 required: true 44 responses: 45 '200': 46 content: 47 '*/*': 48 schema: 49 $ref: '#/components/schemas/FooWrite' 50 description: OK 51components: 52 schemas: 53 FooReadWrite: 54 allOf: 55 - $ref: '#/components/schemas/BarRead' 56 - type: object 57 properties: 58 foo: 59 writeOnly: true 60 type: string 61 FooRead: 62 allOf: 63 - $ref: '#/components/schemas/BarRead' 64 - type: object 65 properties: 66 foo: 67 readOnly: true 68 type: string 69 FooWrite: 70 allOf: 71 - $ref: '#/components/schemas/BarWrite' 72 - type: object 73 properties: 74 foo: 75 writeOnly: true 76 type: string 77 BarRead: 78 anyOf: 79 - $ref: '#/components/schemas/Baz' 80 - type: object 81 properties: 82 bar: 83 readOnly: true 84 type: string 85 BarWrite: 86 anyOf: 87 - $ref: '#/components/schemas/Baz' 88 - type: object 89 properties: 90 bar: 91 writeOnly: true 92 type: string 93 Baz: 94 type: object 95 properties: 96 baz: 97 type: string 98 QuxAllRead: 99 type: object 100 properties: 101 baz: 102 readOnly: true 103 type: string 104 Quux: 105 type: object 106 properties: 107 baz: 108 type: array 109 items: 110 $ref: '#/components/schemas/Baz' 111 qux: 112 $ref: '#/components/schemas/QuxAllRead' 113 Corge: 114 type: object 115 properties: 116 foo: 117 type: object 118 properties: 119 baz: 120 type: boolean 121 writeOnly: true 122 bar: 123 type: object 124 properties: 125 baz: 126 type: boolean 127 readOnly: true