[GH-ISSUE #5838] [feature]: Fix Folder Structure & Example Naming in Importers #2289

Open
opened 2026-03-16 23:51:34 +03:00 by kerem · 2 comments
Owner

Originally created by @shastryrbs on GitHub (Feb 5, 2026).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5838

Is there an existing issue for this?

  • I have searched the existing issues

Feature Request

1. OpenAPI Importer

Current Behavior:

  • Requests are displayed in a flat structure (no folders)

Expected Behavior:

  • Organize requests into folders based on URL path structure (e.g., /api/users/profile creates api > users folders)

2. Postman Importer

Current Behavior:

  • Example responses show as "Untitled" when the response has no explicit name
  • Pre-request and test scripts are not imported

Expected Behavior:

  • Generate meaningful names for examples (e.g., "Example 1", "Example 2")
  • Import scripts from Postman collections (v2.0+)

Solution

OpenAPI Importer

  • Build nested folder structure based on URL path segments
  • Group requests by their endpoint paths

Postman Importer

  1. Example Naming: Fallback to Example ${index + 1} when response name is missing
  2. Script Import: Add optional importScripts parameter with schema validation (v2.0+ only)

Files Modified

  • packages/hoppscotch-common/src/helpers/import-export/import/openapi/index.ts
  • packages/hoppscotch-common/src/helpers/import-export/import/postman.ts

Backward Compatibility

No breaking changes

Why should this be worked on?

User Experience Impact:

  • OpenAPI imports currently create flat, disorganized collections with hundreds of requests in a single level, making navigation extremely difficult for large APIs
  • Postman imports lose critical information (scripts and example names), forcing users to manually recreate automation logic and re-label responses
  • Users migrating from Swagger/OpenAPI or Postman expect their organizational structure and scripts to be preserved

Real-world Use Case:
A developer importing a FastAPI/Django REST API with 100+ endpoints currently sees:

  • All requests in one flat list (no folder structure)
  • Examples labeled "Untitled" instead of meaningful names
  • All pre-request scripts and tests lost

After this fix:

  • Organized folders matching API structure (/api/auth, /api/users, /api/products)
  • Named examples ("Success Response", "Error 404", or "Example 1")
  • Scripts preserved for immediate use

This directly impacts developer productivity and reduces migration friction from other API tools.

Originally created by @shastryrbs on GitHub (Feb 5, 2026). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5838 ### Is there an existing issue for this? - [x] I have searched the existing issues ## Feature Request ### 1. OpenAPI Importer **Current Behavior:** - Requests are displayed in a flat structure (no folders) **Expected Behavior:** - Organize requests into folders based on URL path structure (e.g., `/api/users/profile` creates `api > users` folders) ### 2. Postman Importer **Current Behavior:** - Example responses show as "Untitled" when the response has no explicit name - Pre-request and test scripts are not imported **Expected Behavior:** - Generate meaningful names for examples (e.g., "Example 1", "Example 2") - Import scripts from Postman collections (v2.0+) ## Solution ### OpenAPI Importer - Build nested folder structure based on URL path segments - Group requests by their endpoint paths ### Postman Importer 1. **Example Naming**: Fallback to `Example ${index + 1}` when response name is missing 2. **Script Import**: Add optional `importScripts` parameter with schema validation (v2.0+ only) ## Files Modified - `packages/hoppscotch-common/src/helpers/import-export/import/openapi/index.ts` - `packages/hoppscotch-common/src/helpers/import-export/import/postman.ts` ## Backward Compatibility ✅ No breaking changes ### Why should this be worked on? **User Experience Impact:** - **OpenAPI imports** currently create flat, disorganized collections with hundreds of requests in a single level, making navigation extremely difficult for large APIs - **Postman imports** lose critical information (scripts and example names), forcing users to manually recreate automation logic and re-label responses - Users migrating from Swagger/OpenAPI or Postman expect their organizational structure and scripts to be preserved **Real-world Use Case:** A developer importing a FastAPI/Django REST API with 100+ endpoints currently sees: - ❌ All requests in one flat list (no folder structure) - ❌ Examples labeled "Untitled" instead of meaningful names - ❌ All pre-request scripts and tests lost After this fix: - ✅ Organized folders matching API structure (`/api/auth`, `/api/users`, `/api/products`) - ✅ Named examples ("Success Response", "Error 404", or "Example 1") - ✅ Scripts preserved for immediate use This directly impacts developer productivity and reduces migration friction from other API tools.
Author
Owner

@GaneshAdimalupu commented on GitHub (Mar 2, 2026):

@shastryrbs Have you worked on this ?

<!-- gh-comment-id:3984259605 --> @GaneshAdimalupu commented on GitHub (Mar 2, 2026): @shastryrbs Have you worked on this ?
Author
Owner

@subrahmanya300 commented on GitHub (Mar 2, 2026):

Yes I worked on that.

<!-- gh-comment-id:3984467605 --> @subrahmanya300 commented on GitHub (Mar 2, 2026): Yes I worked on that.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#2289
No description provided.