As per the usage guide, the command line tool can be used to perform opinionated cleanup operations with the -c (or --clean) option. The -n (or --no-flip) option can be used to perform operations whilst keeping the same input data format. With the command line tool, I can then perform cleanup operations without switching input format, for example: cfn-flip -n -c my-test.json my-test1.json or cfn-flip -n -c my-test.yaml my-test1.yaml.
With the Python package instead, it does not seem to be possible to perform a cleanup if input data is YAML and to_yaml() is used; JSON input with to_json() seems to be working as expected. Assuming my_json_input_data is a CloudFormation template content in JSON format, to_json(my_json_input_data, clean_up=True) for example returns a JSON output processed with the cleanup logic. Assuming my_yaml_input_data is a CloudFormation template content in YAML format instead, to_yaml(my_yaml_input_data, clean_up=True) for example results in a json.decoder.JSONDecodeError.
Can you explore, if feasible, the possibility of having to_yaml() take YAML data as input?
As per the usage guide, the command line tool can be used to perform opinionated cleanup operations with the
-c
(or--clean
) option. The-n
(or--no-flip
) option can be used to perform operations whilst keeping the same input data format. With the command line tool, I can then perform cleanup operations without switching input format, for example:cfn-flip -n -c my-test.json my-test1.json
orcfn-flip -n -c my-test.yaml my-test1.yaml
.With the Python package instead, it does not seem to be possible to perform a cleanup if input data is YAML and
to_yaml()
is used; JSON input withto_json()
seems to be working as expected. Assumingmy_json_input_data
is a CloudFormation template content in JSON format,to_json(my_json_input_data, clean_up=True)
for example returns a JSON output processed with the cleanup logic. Assumingmy_yaml_input_data
is a CloudFormation template content in YAML format instead,to_yaml(my_yaml_input_data, clean_up=True)
for example results in ajson.decoder.JSONDecodeError
.Can you explore, if feasible, the possibility of having
to_yaml()
take YAML data as input?Thank you for your time!