-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Expected Behavior
The "Preview" tab in the request pane should safely render the description, or handle non-string values gracefully without showing a library error.
Actual Behavior
When a request has a description field set to a Number (e.g. via a malformed import or database state), clicking the "Preview" tab shows the following error:
Failed to render: marked(): input parameter is of type [object Number], string expected
Reproduction Steps
- Import a request with a numeric description (e.g.,
"description": 12345in the JSON import). - Open the request.
- Click the Docs or Preview tab.
- Observe the error message.
Is there an existing issue for this?
- I have searched the issue tracker for this problem.
Which sync method do you use?
- Git sync.
- Insomnia Cloud sync.
- Local only
Additional Information
Context
This seems related to loose data validation on the description field. The marked library expects a string but is receiving a number.
Possible Solutions
I see two ways to resolve this:
Option 1: Defensive Casting (UI Level) - Recommended
We can explicitly cast the value to a string right before passing it to the marked() library.
- Pros: Prevents the UI error immediately without risking data loss.
- Cons: Doesn't fix the underlying "dirty data".
Option 2: Strict Validation (Import/Model Level)
Update the import logic or the Request model schema to reject or automatically convert non-string descriptions when data enters the application.
- Pros: Ensures data consistency.
- Cons: Might block users from importing older/legacy exports if the validation is too strict.
Insomnia Version
12.1.0
What operating system are you using?
macOS
Operating System Version
Sequoia 15.2
Installation method
insomnia.rest
Last Known Working Insomnia version
No response