Closed talis-fb closed 6 months ago
@talis-fb
What kind of actions related to this feature?
This task if for add a new operator in request items. This is almost same thing of =
body declaration, It is defined HERE and used HERE
Some caveats: All the view core and the flow for parse the Input of user to ViewCommandChoices tries to be purely functional (from functional programing). All these operator are pure functions, that receive ONLY the input of request item, match them and if yes, return the new PartialRequestData with modification, or None otherwise.
To do this task is necessary
fold()
, as the values in from it can also match its regex.serde_json::from_str<Value>
to parse it, and then insert in the map. @SummerGram
I believe these are the steps. Maybe the parse from Value::from_str can be different in some parser of number values. But if it does, you can tell me.
The objective is to replicate this feature in HTTPie (https://httpie.io/docs/cli/non-string-json-fields). The proposal suggests introducing a new operator in Request items to add JSON field. Instead of the traditional
key=value
syntax, users can utilizekey:=value
. This new separator is designed to automatically infer the type of the field when it's a non-string.Expected Behavior
Implement type inference for the following JSON types
true
orfalse
as values)Additional Considerations: