Replies: 11 comments
-
Where do you think the best place to show a warning would be? |
Beta Was this translation helpful? Give feedback.
-
Maybe put a warning triangle right in front of the key name? |
Beta Was this translation helpful? Give feedback.
-
Oh ya, that would work. And show the error message in a tooltip on hover? The warning triangle could even replace the drag handle icon so it won't take up any more space. |
Beta Was this translation helpful? Give feedback.
-
Yeah, that's what I thought about. Good idea to replace the icon! I'm just wondering if this is maybe too subtle. Is there any valid use case where you set a key twice? ^^ |
Beta Was this translation helpful? Give feedback.
-
Ya, we could change the underline color to yellow as well. I think there are probably use cases where duplicate keys are valid but it's probably rare. If it's too subtle, we can also make use of animation to draw the user's eye (eg. shake icon for 1 second). |
Beta Was this translation helpful? Give feedback.
-
This could also be applied to the header editor and form editors as well probably |
Beta Was this translation helpful? Give feedback.
-
👍
Or just pop up the tooltip with the warning for 2 seconds or so and then show it only on hover |
Beta Was this translation helpful? Give feedback.
-
Honestly, I think this is a bad idea. My reasoning is as follows: A query parameter, when repeated, is often used in many languages to handle user input of a List. For example:
would translate to, roughly:
Some languages (such as PHP), or frameworks (such as Rails, iirc) will implement it differently, however. Arrays are passed in like this:
Unfortunately, that methodology is completely incompatible with other languages. For instance, node.js's builtin
So with this feature, you'd actually be nagging at the user to do something that, depending on what their serverside code is written in, they cannot always do. |
Beta Was this translation helpful? Give feedback.
-
Well, the case |
Beta Was this translation helpful? Give feedback.
-
Or maybe it could even be disabled manually like |
Beta Was this translation helpful? Give feedback.
-
I think @damianb has an excellent point. I remember now that I've seen duplicate query parameters used in various web frameworks. I like the idea of disabling inspections (that's what JetBrains IDEs call them). An inspection being a rule (like duplicate query param names) that generates warnings/errors. I think this feature would definitely need a way to disable inspections (maybe on the workspace level?). I'm thinking a dropdown menu inside the tooltip that has the option to disable, then also a menu in the workspace settings to toggle the inspections on and off. |
Beta Was this translation helpful? Give feedback.
-
Details
When I accidentally enter the same query parameter twice Insomnia should warn me about it!
Beta Was this translation helpful? Give feedback.
All reactions