- Issue created by @Akhil Babu
- @marcus_johansson opened merge request.
- 🇩🇪Germany marcus_johansson
Based on discussion with multiple people on this, it will be opt-in for YAML and JSON via new data types.
- 🇩🇪Germany marcus_johansson
The merge also have some code cleanup, but the important part is the YAML and JSON converters.
- 🇮🇳India Akhil Babu Chengannur
I have tested this issue using a YAML string as input to a tool.
If the data type of the tool property is set to 'string', then
$this->getContextValue('property_name')
returns the YAML string value unmodified.When the data type is set to 'yaml_as_string',
$this->getContextValue('property_name')
returns the array corresponding to the YAML.Similarly, if a JSON string is given as input and the data type of the tool property is set to 'json_as_string',
$this->getContextValue('property_name')
returns the result of json_decode().So, moving this to RTBC.
- 🇩🇪Germany marcus_johansson
Just checked this with Michael, and its all good. So getting merged.
-
marcus_johansson →
committed de0d7895 on 1.2.x
Resolve #3533321 "Allow upcasting to"
-
marcus_johansson →
committed de0d7895 on 1.2.x
Automatically closed - issue fixed for 2 weeks with no activity.
- 🇺🇸United States michaellander
Think maybe there's an issue here still.
Is this supposed to be == instead of !==?
if ($data_type !== 'yaml_as_string') { return AppliesResult::notApplicable('The data type is not YAML.'); }
and
if ($data_type !== 'json_as_string') { return AppliesResult::notApplicable('The data type is not JSON.'); }
Since we are saying to not deserialize them if they are one of these two types.