Support complex types as parameter set values #3340
+138
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change
This change updates the parameter sets to support
number
,object
,array
andboolean
values forvalue
sources, e.g.so that the parameter set value can be of the same type as the bundle parameter.
Currently this is only supporter by manually converting the values to their JSON representation, which is less intuitive
It is implemented by updating the unmarsalling code for
Source
so that when parameter with thevalue
strategy is encountered and the hint is not astring
, it is converted to its corresponding JSON string representation.What issue does it fix
Closes #3331
Notes for the reviewer
Since the unmarshalling - and hence value transformation - is performed before the parameter set is stored in the parameter store the value stored will not necessarily match the input parameter set when running
porter parameters apply
, which might not be desirable(?). Even though porter will not itself write values that are not strings to the parameter store, it can read such values from the store as the BSON is converted to JSON and then unmarshalled in the same way as parameter sets from file.Checklist