circleci-config-sdk-ts
circleci-config-sdk-ts copied to clipboard
Bug: Parameters default value mismatch it's type
Is there an existing issue for this?
- [X] I have searched the existing issues
Current behavior
CustomParameter
generates an entry where default parameter is not quoted. That leads to type mismatch in result YAML, since some defaults like true
, on
, and off
can be treated as booleans instead of strings.
new CircleCI.parameters.CustomParameter(
'some_value',
CircleCI.mapping.ParameterSubtype.STRING,
"OFF"
)
parameters:
some_value:
type: string
default: OFF
![image](https://user-images.githubusercontent.com/24507532/206592717-25374484-f5fe-468a-9064-4c1fd6239ffa.png)
Config is not valid
% circleci config validate config.yml
Error: Error in definition of command 'some-command'
Parameter error: default value of parameter 'some_value' is 'false' (type boolean): expected type string
Minimum reproduction code
https://gist.github.com/Kylmakalle/22f2c6eae2bd09758a70be2510284b33
Expected behavior
Any default provided value is "quoted"
properly and aligns with parameter type.
CircleCI Config SDK version
0.12.0
Node.js version
19.0.0
In which operating systems have you tested?
- [X] macOS
- [ ] Windows
- [ ] Linux