Skip to content

Local exports always store the whole folder structure #9482

@selfius

Description

@selfius

Expected Behavior

When exporting only an explicitly selected subset of requests the resulting yaml file should contain only the folders that are ancestors of the selected requests.

Actual Behavior

Exported files always store every folder present in the scratchpad

Reproduction Steps

  1. Create a project structure with multiple folders
Image
  1. Go to 'Scratch Pad > Export'
  2. In 'Export requests' select only one request (i.e. 'Leaf A') and press 'Export'
Image 4. Keep export format as 'Insomnia v5' and press 'Done' 5. Observe that yaml file contains info for all the folder created in step 1 5b. Delete every folder/request from scratchpad and reimport yaml file created in step 4 and observe that this created empty folders with no requests: Image

Is there an existing issue for this?

Which sync method do you use?

  • Git sync.
  • Insomnia Cloud sync.
  • Local only

Additional Information

This is arguably working as expected as users can attach scripts to folders and generally speaking someone might structure their requests in such a way that they rely on side effects from scripts from folders not directly related to said requests.

I would argue that inability to export individual folders forces users to ALWAYS export the whole scratchpad because otherwise it's up to user to manually merge current content of their scratchpad with whatever they just imported from the yaml file (e.g. if you don't delete everything in step 5b above you'll end up with duplicates of each folder)

Possible solutions?:

  1. Export only folder's that are ascendants of selected requests.
  2. Allow the users explicitly select folders in the export dialog (not just infer what folder to include based no selected requests)
  3. Maybe change import such that merges folder based on their names?

Insomnia Version

Latest version from github

What operating system are you using?

Ubuntu

Operating System Version

Ubuntu 24.04.3 LTS

Installation method

Built from sources

Last Known Working Insomnia version

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-bugBug: general classificationS-unverifiedStatus: Unverified by maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions