| 14 | const debug = createDebugger('assembler:info'); |
| 15 | |
| 16 | export class DocumentInfoAssembler implements Assembler.Document { |
| 17 | assemble(context: DocumentContext): void { |
| 18 | const { name, version } = context.strapi.config.get<StrapiInfoConfig>('info'); |
| 19 | |
| 20 | debug(`assembling document's info for %O...`, { name, version }); |
| 21 | |
| 22 | const info: OpenAPIV3_1.InfoObject = { |
| 23 | title: this._title(name), |
| 24 | description: this._description(name, version), |
| 25 | version, |
| 26 | }; |
| 27 | |
| 28 | debug(`document's info assembled: %O`, info); |
| 29 | |
| 30 | context.output.data.info = info; |
| 31 | } |
| 32 | |
| 33 | private _title(name: string) { |
| 34 | return `${name}`; |
| 35 | } |
| 36 | |
| 37 | private _description(name: string, version: string) { |
| 38 | return `API documentation for ${name} v${version}`; |
| 39 | } |
| 40 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…