

Swagger setup const config = new DocumentBuilder()
INSOMNIA API DESIGNER HOW TO
How to do this will of course also vary depending on your stack, but in NestJS, a full swagger config sample might look like this (in main.ts):Ĭonst app = await NestFactory.create(AppModule) In any case, what you want to do is to take the HTML snippet that the previous page has generated for you and set it as the description of your swagger spec. Since this particular example is a NestJS project running on express, the swagger schema is available under an api-json endpoint instead. For dotnet projects, this tends to be a swagger.json file. The Import URL will likely depend on your implementation.

Say goodbye to importing a curl for each endpoint individually. See this beautiful Run in Insomnia button? When you hit that, Insomnia will open up and ask you if you want to import the collection, making it super-easy to put together a comprehensive collection of API endpoints. Insomnia starts faster, is easier to navigate and simpler to use - in my humble opinion. But for us software devs, I think it’s overkill. Their test runner in particular is very full-featured, and is probably in the toolbox of every QA / QE.

That’s right! Move over Postman, you’ve got some competition! Hold up, what’s wrong with Postman?Īn obsession with tabs? Clunky UX? A slow startup? Don’t get me wrong - I think Postman offers a very robust product that’s a useful tool for the right job. When you read insomnia here, I’d forgive you for thinking of sleepless nights or the edgy song from the 90s - but I’m actually talking about Insomnia the REST client. Today, I wanted to show you all how to create an Insomnia-First swagger page, so your API can easily be consumed by Insomnia, all in one go.
