JSONPath support for yaml compare analyzer
Opened this issue · 0 comments
Describe the rationale for the suggested feature.
The YAML compare has a path
parameter that is used to path a jsonpath
-ish expression to select a field to compare inside a YAML document. Its based on GetAtPath implementation which is not fully compliant to the jsonpath specification. item[0].name
does not work for example. It should be items.[0].name
in our implementation. There might be a few others cases.
Describe the feature
Introduce a new field jsonPath
parameter that uses https://pkg.go.dev/k8s.io/client-go/util/jsonpath library which is compliant to the jsonpath specification. #1244 PR is work that adds the same field to the JSON compare analyser. Aim to have a similar implementation to ensure the behaviour of the analysers remains the same.