fork of hey-api/openapi-ts because I need some additional things

Add test case for nested allOf discriminator bug

Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>

+94
+94
specs/3.0.x/discriminator-allof-nested.json
··· 1 + { 2 + "openapi": "3.0.3", 3 + "info": { 4 + "title": "Minimal Polymorphic Discriminator Reproduction", 5 + "version": "1.0.0", 6 + "description": "Demonstrates an issue where TypeScript type generation results in wrong discriminator for nested allOf inheritance with discriminators at multiple levels." 7 + }, 8 + "paths": { 9 + "/cars": { 10 + "get": { 11 + "summary": "Get cars", 12 + "responses": { 13 + "200": { 14 + "description": "List of cars", 15 + "content": { 16 + "application/json": { 17 + "schema": { 18 + "type": "array", 19 + "items": { 20 + "oneOf": [ 21 + { "$ref": "#/components/schemas/CarDto" }, 22 + { "$ref": "#/components/schemas/VolvoDto" } 23 + ] 24 + } 25 + } 26 + } 27 + } 28 + } 29 + } 30 + } 31 + } 32 + }, 33 + "components": { 34 + "schemas": { 35 + "VehicleDto": { 36 + "type": "object", 37 + "required": ["$type", "id"], 38 + "properties": { 39 + "$type": { 40 + "type": "string" 41 + }, 42 + "id": { 43 + "type": "integer" 44 + } 45 + }, 46 + "discriminator": { 47 + "propertyName": "$type", 48 + "mapping": { 49 + "Car": "#/components/schemas/CarDto", 50 + "Volvo": "#/components/schemas/VolvoDto" 51 + } 52 + } 53 + }, 54 + "CarDto": { 55 + "allOf": [ 56 + { "$ref": "#/components/schemas/VehicleDto" }, 57 + { 58 + "type": "object", 59 + "required": ["$type", "modelName"], 60 + "properties": { 61 + "$type": { 62 + "type": "string" 63 + }, 64 + "modelName": { 65 + "type": "string" 66 + } 67 + }, 68 + "discriminator": { 69 + "propertyName": "$type", 70 + "mapping": { 71 + "Car": "#/components/schemas/CarDto", 72 + "Volvo": "#/components/schemas/VolvoDto" 73 + } 74 + } 75 + } 76 + ] 77 + }, 78 + "VolvoDto": { 79 + "allOf": [ 80 + { "$ref": "#/components/schemas/CarDto" }, 81 + { 82 + "type": "object", 83 + "required": ["$type", "seatbeltCount"], 84 + "properties": { 85 + "seatbeltCount": { 86 + "type": "integer" 87 + } 88 + } 89 + } 90 + ] 91 + } 92 + } 93 + } 94 + }