fork of hey-api/openapi-ts because I need some additional things
at main 76 lines 2.0 kB view raw
1{ 2 "openapi": "3.1.0", 3 "info": { 4 "title": "Defaults with $ref and anyOf", 5 "version": "1.0.0" 6 }, 7 "paths": {}, 8 "components": { 9 "schemas": { 10 "AudioFormat": { 11 "type": "string", 12 "enum": ["pcm_16bit_44.1khz", "pcm_16bit_24khz"] 13 }, 14 "Language": { 15 "type": "string", 16 "enum": ["en", "es", "fr"] 17 }, 18 "NestedConfig": { 19 "type": "object", 20 "properties": { 21 "model": { 22 "type": "string", 23 "default": "gpt-4" 24 }, 25 "temperature": { 26 "type": "number", 27 "default": 1 28 } 29 }, 30 "required": ["model", "temperature"] 31 }, 32 "TestSchema": { 33 "type": "object", 34 "properties": { 35 "primitiveDefault": { 36 "type": "number", 37 "default": 42 38 }, 39 "refWithPrimitiveDefault": { 40 "$ref": "#/components/schemas/AudioFormat", 41 "default": "pcm_16bit_44.1khz" 42 }, 43 "refWithObjectDefault": { 44 "$ref": "#/components/schemas/NestedConfig", 45 "default": { 46 "model": "gpt-4", 47 "temperature": 1 48 } 49 }, 50 "anyOfWithNullDefault": { 51 "anyOf": [{ "type": "number" }, { "type": "null" }], 52 "default": null 53 }, 54 "anyOfWithRefAndNullDefault": { 55 "anyOf": [ 56 { "$ref": "#/components/schemas/Language" }, 57 { "type": "null" } 58 ], 59 "default": null 60 }, 61 "optionalAnyOfWithDefault": { 62 "anyOf": [{ "type": "string" }, { "type": "null" }], 63 "default": null 64 } 65 }, 66 "required": [ 67 "primitiveDefault", 68 "refWithPrimitiveDefault", 69 "refWithObjectDefault", 70 "anyOfWithNullDefault", 71 "anyOfWithRefAndNullDefault" 72 ] 73 } 74 } 75 } 76}