[Feature request] Auto-Generate XML Request Bodies from OpenAPI spec and prevent deletion of manually edited ones
- Dominant language
- TypeScript
- Stars
- 40k
- Forks
- 2.4k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 61
Description
**Question**
1. How does one get Insomnia to auto-generate XML Request Bodies?
2. How does one get Insomnia to not delete manually created XML Request Bodies if auto-generate doesn't work or isn't desired?
In contrast to `requestBody.content.application/json` (which does auto-generate Request Body), when using `requestBody.content.application/xml` Insomnia Designer is **NOT** auto-generating a Request Body as implied in documentation [here](https://support.insomnia.rest/article/98-debugging). And it's deleting any manually created Request Body after navigating to the `Design` tab.
It appears that some **code or plugin** to auto-generate XML is missing and that the **refresh / re-generate request body** logic operates without awareness that there is nothing that is going to auto-generate a new Request Body for XML.
**Context**
I'm trying to create test cases for XML APIs. I find that I can do that only by manually creating a Request Body. However once doing so, Insomnia will delete the manually created Request Body after the `Design` Tab is clicked. This makes Insomnia almost usuable for testing.
The sequence to see the XML Request Body deleted is strange (has a couple extra steps) because Insomnia has a wider issue (also occurs after a Git Update) with not automatically refreshing screens immediately when a change happens.
To recreate:
1. Click `Design`. Create or access OpenAPI Spec with `requestBody.content.application/xml`
2. Click `Debug`. Select `XML`. **See nothing auto-generated**
3. Enter XML Request Body. _Optionally Send. Optionally Generate Tests and Execute. Optionally click back and forth between_ `Debug` _and_ `Test`. _Optionally restart Insomnia._ **See XML Request Body saved in all cases.**
4. Click `Design`. Make no changes. Click `Debug`. Click `Design` or `Test`. Click `Debug`. **See XML Request Body deleted**.
Contributor guide
Research direction
Reproduce the behavior from the Design, Debug, and Test tabs using an OpenAPI requestBody.content.application/xml definition. Trace the request-body refresh and regeneration flow, then define done as XML bodies being generated when supported and manually entered XML bodies no longer being deleted when generation is unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100