Hello everyone.
The other day I was modifying a connector function and changed the name of an input. Unfortunately I forgot that this input was referenced, which temporarily broke the connector function.
I think this is very easily overlooked, especially when many connector functions are used and/or when editing an old function you are not used to anymore.
I suggest that a warning is displayed to the user if he modifies an input name and breaks a $ reference in doing so. More precisely, if a foo input exists and is referenced with $foo$
somewhere:
- The user modifies the input name to something different, e.g. from foo to bar.
- When the user does this, Tulip looks for all
$foo$
references it can find (path, query parameters, request body…). - If no reference is found, Tulip does nothing. If a reference is found, Tulip displays a small warning triangle in the field the user modified. On hovering it, a tooltip would display something appropriate, like There are some broken references to this field. Please check places where this input is used to make sure everything works as you want.
- The warning would remain as long as at least one
$foo$
exists somewhere. If the user changes their mind and renames again from bar to foo, the warning disappears. - If the user saves the function and there are still some broken references, a modal would be displayed, asking the user to confirm the action. While probably very rare, this might be something the user desires to do.
The main idea is to take into account the name of inputs as they were written when the user accessed the connector function edit page.