-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only re-encode subst value if it smells like json and target doc is yaml #785
Only re-encode subst value if it smells like json and target doc is yaml #785
Conversation
Running the tests for this pr. |
All tests passed with this pr. |
@dee0sap Can you please sign your commits? Then we can merge this. :) |
Head branch was pushed to by a user without write access
820db72
to
4120ff7
Compare
4120ff7
to
0556c2e
Compare
If target is json then of course value must be json. Not much to talk about there. However if target is yaml and value is json then we would like to convert the json to yaml first so we don't have a target that looks like a mix of yaml and json. That said, if value and target are both yaml then we would like to preserve whatever is in the value. e.g. anchors and refs, string styles etc.
…look like json and if the target file is not json.
0556c2e
to
4512e41
Compare
2cf362c
to
83c3afd
Compare
Done |
Oh f*ck. The linter update, of course, will kill everything. |
Sorry, I'm going to bed, we'll have to deal with those tomorrow. Sorry, Dan. :( |
Description
Currently we always re-encode subst value in an effort to have its encoding ( json or yaml ) match that of the target document. More specifically we are trying to avoid having something that looks like a yaml doc with json mixed into it as this is off putting.
The problems with this are
With this PR we only perform the re-encoding if the target is not json and if the subst value 'smells' like json.
What type of PR is this? (check all applicable)
Related Tickets & Documents
Please see discussion between myself and @Skarlso
Screenshots
Added tests?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Added to documentation?
Checklist: