()
| 28 | } |
| 29 | |
| 30 | public GetSpec(): Swagger.Spec3 { |
| 31 | let spec: Swagger.Spec30 = { |
| 32 | openapi: '3.0.0', |
| 33 | components: this.buildComponents(), |
| 34 | info: this.buildInfo(), |
| 35 | paths: this.buildPaths(), |
| 36 | servers: this.buildServers(), |
| 37 | tags: this.config.tags, |
| 38 | }; |
| 39 | |
| 40 | if (this.config.spec) { |
| 41 | this.config.specMerging = this.config.specMerging || 'immediate'; |
| 42 | const mergeFuncs: { [key: string]: (spec: UnspecifiedObject, merge: UnspecifiedObject) => UnspecifiedObject } = { |
| 43 | immediate: Object.assign, |
| 44 | recursive: mergeAnything, |
| 45 | deepmerge: (spec: UnspecifiedObject, merge: UnspecifiedObject): UnspecifiedObject => deepMerge(spec, merge), |
| 46 | }; |
| 47 | |
| 48 | spec = mergeFuncs[this.config.specMerging](spec as unknown as UnspecifiedObject, this.config.spec as UnspecifiedObject) as unknown as Swagger.Spec30; |
| 49 | } |
| 50 | |
| 51 | return spec; |
| 52 | } |
| 53 | |
| 54 | protected buildInfo() { |
| 55 | const info: Swagger.Info = { |
no test coverage detected