Skip to content
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

Implement the "complex mapping key" from YAML spec #1559

Closed
peruzzof opened this issue Feb 16, 2023 · 1 comment
Closed

Implement the "complex mapping key" from YAML spec #1559

peruzzof opened this issue Feb 16, 2023 · 1 comment

Comments

@peruzzof
Copy link

Please describe your feature request.
Implement the "complex mapping key", per YAML spec (https://yaml.org/spec/1.2.2/ Example 2.11)

Describe the solution you'd like
If we have data1.yml like:
(please keep to around 10 lines )

? - Detroit Tigers
  - Chicago cubs
: - 2001-07-23

And we run a command:

yq '.' data1.yml

it could output

? - Detroit Tigers
  - Chicago cubs
: - 2001-07-23

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
I found this limitation while trying to use a tool called "oasdiff", but the generated YAML is not properly parsed by yq. I raised an issue (Tufin/oasdiff#94) with the tool itself and they pointed me to the specification.

@mikefarah
Copy link
Owner

As fas as I can tell, this is what yq does already?

yq '.' data1.yaml 
? - Detroit Tigers
  - Chicago cubs
: - 2001-07-23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants