Closed as not planned
Closed as not planned
Description
Clear and concise description of the problem
Why build a version of the openapi3 as a JSON object when TSP can output the openapi and it can be directly included in the project by relative path as a yaml file?
If the issue is you need to control that the openapi schema is generated even if it hasn't been requested, create the openapi3.yaml file, instead of a .ts file.
From npm package for swagger-ui-express: Load swagger from yaml file.
const express = require('express');
const app = express();
const swaggerUi = require('swagger-ui-express');
const fs = require("fs")
const YAML = require('yaml')
const file = fs.readFileSync('./swagger.yaml', 'utf8')
const swaggerDocument = YAML.parse(file)
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));
Checklist
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.