-
Notifications
You must be signed in to change notification settings - Fork 216
Conversion creates a different file structure #836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
When converting an OAS 3.0 specification to a Postman collection using tools like openapi-to-postman, the generated collection creates nested folders based on URL path segments (e.g., /auth/register becomes Account > auth > register). The user expects a flat structure with all endpoints directly under the parent folder (e.g., all methods under Account), avoiding unnecessary nesting. Root Cause Path /auth/register → Folders auth > register. Path /users/{page} → Folders users > {page}. This behavior is standard but often clashes with user preferences for simpler, flatter collections. Solutions
openapi-to-postman: Use the --folderStrategy flag to group endpoints by tags instead of paths. openapi2postmanv2 -s oas.yaml -o postman.json -O folderStrategy=Tags postman-code-generators: Use Postman’s built to customize folder logic during import.
Remove redundant path segments: Simplify paths (e.g., use /register instead of /auth/register). Use x-postman-meta: Some tools allow custom metadata to control grouping. paths: const fs = require('fs'); // Flatten all requests to the root folder fs.writeFileSync('flattened-postman.json', JSON.stringify(collection)); Steps: Upload your OAS file. Set output_format=postman. (Optional) Use group_by=tags if you prefer tag-based grouping. |
@eo33 @HabiburRahmaan As mentioned by @thim81, you can make use of Here's how the generated collection look like using Do let us know if this solves your issue or give your feedback on the suggested approach if it's missing anything. |
It almost feels like PostBot should do this conversion. Then the structure, names and descriptions would be interesting to see where it goes. Just an idea 😛 @abhijitkane |
Hey there 👋 I have an OAS 3.0 and would like to convert it to a Postman collection. The
openapi-to-postman
command works, and the OAS file was successfully converted to a Postman collection, but the collection generated follows a different file structure.What happened?
This OAS file was successfully converted to this Postman collection file. But the collection follows this folder structure:
This is what it looks like when rendered with Postman:

What do I expect to happen?
The folder structure of the postman collection to follow this:
This is what it looks like in Postman:

Here's the Postman collection file.
The text was updated successfully, but these errors were encountered: