()
| 27 | // Override with OpenAPI 3.1 specific return type |
| 28 | // The base class returns Swagger.Spec30, but this generator produces Swagger.Spec31 |
| 29 | public override GetSpec(): Swagger.Spec31 { |
| 30 | let spec: Swagger.Spec31 = { |
| 31 | openapi: '3.1.0', |
| 32 | components: this.buildComponents() as Swagger.Components31, |
| 33 | info: this.buildInfo(), |
| 34 | paths: this.buildPaths() as { [name: string]: Swagger.Path31 }, |
| 35 | servers: this.buildServers(), |
| 36 | tags: this.config.tags, |
| 37 | }; |
| 38 | |
| 39 | if (this.config.spec) { |
| 40 | this.config.specMerging = this.config.specMerging || 'immediate'; |
| 41 | const mergeFuncs: { [key: string]: (spec: UnspecifiedObject, merge: UnspecifiedObject) => UnspecifiedObject } = { |
| 42 | immediate: Object.assign, |
| 43 | recursive: mergeAnything, |
| 44 | deepmerge: (spec: UnspecifiedObject, merge: UnspecifiedObject): UnspecifiedObject => deepMerge(spec, merge), |
| 45 | }; |
| 46 | |
| 47 | spec = mergeFuncs[this.config.specMerging](spec as unknown as UnspecifiedObject, this.config.spec as UnspecifiedObject) as unknown as Swagger.Spec31; |
| 48 | } |
| 49 | |
| 50 | return spec; |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Override to add tuple type support (OpenAPI 3.1 feature via prefixItems) |
nothing calls this directly
no test coverage detected