A VS Code extension that generates a Postman Collection v2.1 JSON file from an ASP.NET Core controller.
Use
Open a C# controller in VS Code, or run the command and select a .cs file.
Open the Command Palette and run Generate Postman Collection from ASP.NET Controller.
Enter the API base URL, for example https://localhost:5001.
Choose where to save the generated .postman_collection.json file.
Import that JSON file into Postman.
The base URL is saved as a baseUrl collection variable. Route placeholders and action parameters become Postman path or query variables. Requests include an Accept: application/json header; body requests also include Content-Type: application/json. [FromHeader] parameters become header variables. For a request model, the extension looks for a matching .cs file in the workspace and builds a JSON example from its public gettable properties; primitive properties receive representative defaults such as "", false, or 0.
Development
The extension uses Node.js built-ins and the VS Code extension API; no npm install is needed to run its tests:
npm test
To try it in VS Code, open this folder as an extension development workspace and press F5. The generated collection is saved next to the selected controller by default.