Is it possible to generate an API from a collection in Postman?

Viewed 160

A normal use case in Postman seems to be to generate a collection from an API. This lets you do things like importing an externally defined API, and then generating a collection of calls that you can then make from Postman. I have the converse situation. I have a complete Postman collection from an API provider, but no API definition. Is there anything like "Turn this collection into an API definition." in Postman?

2 Answers

I've built a tool that allows you to do this for a GraphQL API. (https://www.npmjs.com/package/graphql-testkit)

You could simply do something like this

graphql-testkit \ 
--endpoint=https://api/spacex.land/graphql\ 
--header="Authorization:123,x-ws-system-id=10" \
--maxDepth=4

and it would automatically generate the collection for you.

Related