I've got swagger set up on my application, but a known issue is that it needs a class to generate documentation about. Normally an interface will not work since that's not runtime code.
I found this project typeconv that can generate OpenAPI schema files form TS interfaces: https://github.com/grantila/typeconv
So I run npx typeconv -f ts -t oapi -o swagger-schemas --oapi-format json 'src/**/models/*.ts' and it generates swagger-schemas/{folder}/model/*.json files
Now that I have these, how do I add them to my Nest-Swagger config so it know about them?
In my main.ts this is my pretty basic setup:
const swaggerConfig = new DocumentBuilder()
.setTitle('Example Server')
.build();
const swaggerDocument = SwaggerModule.createDocument(app, swaggerConfig);
SwaggerModule.setup(swaggerPath, app, swaggerDocument);