Using Postman Collections as a source in a Ruby on Rails code generation pipeline

The problem I’m experiencing is that I have some alternatives and theoretical ideas in mind, though I don’t really know which one is best to choose.

Problem description I got a big enough Postman API collection of 20-30 supplier APIs. It’s been built based on various OpenAPI imports from each supplier’s public specification and for some it was a manual collection writing based on their .DOC or .PDF docs. It’s been accumulating for 2 years now, our Postman collection.

I started to work on an internal project, a Ruby on Rails API that needs to communicate to these 20-30 suppliers, and in order to integrate to them, I have to manually write the API Adapter layer mapping the tests and examples from Postman. I use the RestClient Ruby gem.

In order to save time with the process, I’ve been thinking of a way to improve this development experience and eventually save some time.

The options I could think of I have in mind:

  1. Either to manually export the Postman Library as OpenAPI JSON, supplier by supplier, collection by collection, and use each of the 20-30 resulting JSON files as input for OpenAPI Code Generator.
  2. Regarding the manually export part at 1., maybe there’s a way to make it automatic by using Postman Collection Runner or maybe via Newman CLI
  3. Regarding the JSON files part at 1., I believe the codegenerator works with YAML and maybe I need a JSON → YAML convertor in between
  4. In order to keep Postman in sync, regarding 1., with Rails RestClient adapter layer, I thought that maybe there’s some sort of pipeline I could build, so when a change occurs in the collection to trigger a job to get the code for it
  5. To make use of Postman as a sort of microservice, making it the place to go, develop, configure the supplier APIs library and then to connect the Rails service with a sort of Rails gem Postman REST client adapter, and hopefully to have some autocomplete.
  6. To export and migrate whole Postman collections to a sort of API aggregator tool. Any recommendation might help. Then to connect with Rails to that tool.

Hope it makes some sense and hope I’m not asking too much details. If you knew of any such projects or references, that might help.