Forum Discussion

chewbika's avatar
chewbika
Occasional Contributor
12 months ago
Solved

Mass import Postman collection/requests into Swagger Explore API/operation

I inherited an old code base that doesn't have any API documentations and I want to use Swagger Hub for it. We fortunately have a collection in Postman for most of the endpoints.

I am following the instructions in the Explore.cli.
Explore What's New - Import Postman Collection | SmartBear Community

I want to confirm the expected behaviours on import of a Postman collection since this feature is not in the documentations yet: I imported a Postman collection json file of about 60 requests.
Each Postman request created an API and within the API contains a singular Operation (e.g. GET /user/).


If so, is there a way to import the entire Postman collection's into a single API with the 60 requests as Operations?

6 Replies

  • chewbika's avatar
    chewbika
    Occasional Contributor

    The explore.cli verbose said all requests OK with connection created.
    I also tried to add folder with 4 Postman requests but it didn't seem to make a difference when it gets imported as all 4 requests were imported as API with a singular operation.

  • Hi there,

    This is really interesting, and I’m looking into similar functionality. I wanted to ask if it's possible to develop a tool similar to how InShot Editor functionsβ€”something user-friendly and intuitiveβ€”but for managing API documentation or collections, like with Swagger or Postman.

    For example, could we build a solution that allows importing an entire Postman collection into a single Swagger API, where all requests are automatically structured as operations under one API, instead of creating multiple APIs for each individual request? I believe this would streamline the process significantly, especially for legacy codebases like the one I’m working with.

    Would something like this be feasible?

    Thanks!

  • chewbika's avatar
    chewbika
    Occasional Contributor

    I see a PR that includes the Github issues above...
    https://github.com/SmartBear-DevRel/explore-cli/pull/40

  • We’ve released 0.8.0 of π—˜π˜…π—½π—Ήπ—Όπ—Ώπ—².𝗖𝗹𝗢 which now has support for nested Postman Collections as part of it’s import.


    Root level requests are now added to an Explore API folder with same name as Explore Space (e.g. Postman collection 'foo' with requests will create Explore Space 'foo' with API folder 'foo' which will contain the request connections).

    Nested folders within a collection, will have a name format of Parent - Child (e.g. foo/bar will create API folder called foo - bar, foo/bar/baz will create API folder called foo - bar - baz)

    Also, in case you missed it, we also support  an`πš’πš–πš™πš˜πš›πš-πš™πšŠπšŒπš-πšπš’πš•πšŽ` feature allowing you to explore the API calls representing consumer expectations within a Pact contract.

    Install via Nuget: https://www.nuget.org/packages/Explore.Cli
    Standalone binaries: https://github.com/SmartBear-DevRel/explore-cli/releases/tag/0.8.0