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

Support for YML Path Patterns #490

Closed
gfs opened this issue Aug 4, 2022 · 4 comments · Fixed by #509
Closed

Support for YML Path Patterns #490

gfs opened this issue Aug 4, 2022 · 4 comments · Fixed by #509
Labels
enhancement New feature or request

Comments

@gfs
Copy link
Contributor

gfs commented Aug 4, 2022

As a follow up from #420 it would be nice to also support YAMLPath. I haven't found a C# library that has the functionality we need yet but YamlDotNet has an open feature request for this functionality (aaubry/YamlDotNet#333).

@gfs gfs added the enhancement New feature or request label Aug 4, 2022
@valinha
Copy link

valinha commented Aug 11, 2022

Maybe a solution would be to convert the yml to json and then apply json-path to it. Clearly it is important to narrow down the scope of the rules very much.

@gfs
Copy link
Contributor Author

gfs commented Aug 11, 2022

Maybe a solution would be to convert the yml to json and then apply json-path to it.

I did consider this earlier and while technically possible to do the conversion, this means you don't get the information about where in the file the match occurred - you'd be able to identify in the converted JSON where it occurred - but there's no mapping from that back to where the finding is the YML file.

@gfs
Copy link
Contributor Author

gfs commented Aug 30, 2022

YAMLPath is specified here: https://github.com/wwkimball/yamlpath/wiki/Segments-of-a-YAML-Path it might be possible to build this as extension methods on YamlMappingNode from YamlDotNet.

@gfs
Copy link
Contributor Author

gfs commented Sep 27, 2022

This is live in 1.6.22. If you encounter any issues please let me know with the specific query you're having trouble with.

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

Successfully merging a pull request may close this issue.

2 participants