0

So I currently already have the swagger UI set up with the page and everything, but I want to edit the .json file (so I can provide descriptions, error codes and stuff but all in one document). Was just wondering where I should be locating my swagger.json or swagger.yaml file to be able to adjust the API??

If not, what's the best practice for documenting parameters, response codes and descriptions WITHOUT having to do it tediously one by one like below...

enter image description here

Any advice on using swagger with nestjs applications would be much appreciated :) Still very new with using it

1
  • 1
    Swagger.json file is generated at runtime, and you can access it at http://<your domain>:<port>/api-json Commented Jul 13, 2022 at 12:23

1 Answer 1

0
In NestJS, you can use the @nestjs/swagger package to generate Swagger documentation for your API. This package provides decorators that allow you to add Swagger metadata to your controllers, methods, parameters, and responses.

To generate a Swagger JSON or YAML file, you can use the SwaggerModule provided by the @nestjs/swagger package. This module has a setup method that takes in a configuration object where you can specify the location of your Swagger file. 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.