Skip to content

Body override lost if result is invalid #531

@LucasPickering

Description

@LucasPickering

Did you search for existing issues already?

Yap

Describe the bug
A clear and concise description of what the bug is

If you override a raw/JSON body in the TUI but the provided template is invalid, the body reverts to the default from the recipe. This can be frustrating if you made a bunch of changes that are now lost.

To Reproduce
Steps to reproduce the behavior

  1. Create a recipe with a raw body
  2. Open it in the TUI
  3. Edit the body
  4. Change it to make it an invalid template (e.g. have an opening {{ with no closing }})
  5. Save and exit
  6. When returning to the TUI, it will show the parse error but the body override will be the default from the recipe

Expected behavior
A clear and concise description of what you expected to happen

The editor should retain the invalid body but make it clear in the UI that it's not valid. The invalid body should not block sending a request. When a request is sent, we have two options:

  • Use the default from the recipe
  • Use the invalid body
    The first option is easier, especially for JSON bodies, because plumbing around an invalid template/JSON object is a lot harder. Whatever we choose, it should be clear to the user what will happen.

Screenshots
If applicable, add screenshots to help explain your problem

Version (please complete the following information):

  • OS:
  • Terminal:
  • Slumber Version:

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions