DEV Community

Victor Motogna
Victor Motogna

Posted on

2 1

Automatically generate Postman collection from Apipie docs

I often found myself having to create a Postman collection from our API so it's easier to test between the members of the team. But each time the collection ends up incomplete and it's a hassle to keep up to date.

For that reason, I created a new Ruby gem (Github) that automatically generates a Postman collection with all the tested endpoints covered with Apipie.

How to use it

The setup & usage are pretty easy:

  • add the gem to your :development, :test group in the Gemfile
  • generate a Postman API key; details here
  • add an initializer file to config/initializers/apipie_postman.rb:
ApipiePostman.configure do |config|
  config.postman_api_key = 'your_postman_api_key'
  config.postman_collection_name = 'Your collection name'
  config.base_url = 'localhost:3000' # the base_url that you want in your postman collection
end
Enter fullscreen mode Exit fullscreen mode
  • run bundle exec apipie-postman - this will create the apipie_postman.rake file
  • run bundle exec rake apipie_postman to run the task and generate docs

Conclusion

Please let me know if you like it and any feedback you might have.

If any of you would like to contribute to the project, I also set up a contributing guideline.

API Trace View

Struggling with slow API calls? đź‘€

Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post