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

Add YAML support #91

Open
jviotti opened this issue Jun 14, 2024 · 7 comments
Open

Add YAML support #91

jviotti opened this issue Jun 14, 2024 · 7 comments

Comments

@jviotti
Copy link
Member

jviotti commented Jun 14, 2024

No description provided.

@UnleashSpirit
Copy link

Need it too, VSCode extension YAML of redhat does it but we need a cli docker tool for CI :)

@jviotti
Copy link
Member Author

jviotti commented Jul 1, 2024

I'm on vacations at the moment, but I'll take care of it very soon!

@akselerando
Copy link

YAML support would be much appreciated!

@robbat2
Copy link

robbat2 commented Nov 6, 2024

another +1 on yaml; to save the yq conversion before running jsonschema

@jviotti
Copy link
Member Author

jviotti commented Nov 6, 2024

I promise I'll get into it soon! I gave it a shot back then, but correctly implementing commands like fmt on YAML proved to be a bit of a challenge. I think I'll implement it at least for the commands that it's easier to do as a first step. If you are aware of a YAML parser/stringifier in C/C++ that is dependency-free, please let me know!

@robbat2
Copy link

robbat2 commented Nov 9, 2024

I promise I'll get into it soon! I gave it a shot back then, but correctly implementing commands like fmt on YAML proved to be a bit of a challenge. I think I'll implement it at least for the commands that it's easier to do as a first step.

I agree fmt is a challenge, but maybe leave that out as a later part. Focusing on reading / convert to JSON / validate.
There are a lot of options & ways to format YAML that are all "correct" but stylistic choices that make more sense in some documents than others (e.g. a short array being inlined, but a longer array being split over lines).

If you are aware of a YAML parser/stringifier in C/C++ that is dependency-free, please let me know!
Quick research for you:

project license dependencies notes
https://github.com/jbeder/yaml-cpp MIT cmake not maintained anymore? concerns about const-correctness jbeder/yaml-cpp#1275
https://github.com/pantoniou/libfyaml/ MIT+GPL2+BSD-2-Clause xxhash bundled not sure how alive upstream is
https://pyyaml.org/wiki/LibYAML MIT cmake
https://github.com/tlsa/libcyaml ISC libyaml & make most active library I can see

@jviotti
Copy link
Member Author

jviotti commented Nov 11, 2024

Thanks a lot for the research @robbat2 ! Worth giving libYAML and libcyaml a shot

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

No branches or pull requests

4 participants