Mandatory answer and weird behavior with no default value
See original GitHub issueThe documentation says: default: Leave empty to force the user to answer.
When not specifying the default
key, the default value is None
; perfect.
But the prompt shows 🎤 [None]:
.
I think it should be 🎤 :
maybe with above that VAR_NAME? Required. Format: str
When pressing enter, it should not accept an empty answer and should ask again (i.e. force the user to enter a value… as mandatory, and as described in the doc)
Currently, if pressing enter, that variable is None
and using it in another default value “as a string”, if becomes the string"None"
… which is a known “problem” with Jinja (or Django templates at least).
Wouldn’t it be better to use an empty string ""
rather than None
(for str
variables)?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Expectation/Request: "default" implies "required" #407 - GitHub
It's possible the behavior is localized to this context, and that the default value is set in e.g. the decorated function. I haven't...
Read more >Default value not working for Property Validation Rule
Hello Experts, We use properties under Request/Incident/Problem Area. I created a property and associated with a Property validation rule ...
Read more >Should switch statements always contain a default clause?
Switch cases should almost always have a default case. Reasons to use a default. 1.To 'catch' an unexpected value
Read more >ScriptRunner Behaviours - default description overwritten
I have a problem with an initialiser behaviour setting the default description. Note that this only occurs when the create issue screen is ......
Read more >Unassigned Data Source and Mandatory Query Variables ...
The behavior of the script is a little strange indeed. If you assign a default value or if the mandatory variable has a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think that the “default” field should not be used to indicate that the answer is required, a field called “required” or “mandatory” should be created, if the “default” field is used then it is equivalent to required=false but an empty string in the default field should not imply required=true since in some cases the default value may be an empty string. Also the “required” field should be true by default.
And if the “validator” field is implemented then it should work together with that field.
I had not, thank you for pointing this out. This does constitute a viable work-around for the problem.