I have Swagger, which works just fine. But I cant find a way to export the routes to JSON. I remember of doing this, just by visiting a URL in the browser, but I can't remember it now.
My swagger is setup like this:
const swaggerOptions = new DocumentBuilder()
.setTitle('Some API Docs')
.setDescription('Some API description')
.setVersion('1.0')
.build();
const swaggerDocument = SwaggerModule.createDocument(app, swaggerOptions);
SwaggerModule.setup('docs', app, swaggerDocument);
And I can access the Swagger UI using: localhost:3000/docs
I have read the official documentation, and they mention to use:
Also, I looked on SO, and there is this thread
Unfortunately, none of it works in my case.
What is the URL to get the documentation in JSON?
Based on your SwaggerModule configuration the URL for JSON should be at /docs-json
.
The official documentation mentions api-json
because they register using api
as the first param