jsonpath icon indicating copy to clipboard operation
jsonpath copied to clipboard

Honor JSON annotations

Open catalin-me opened this issue 4 years ago • 0 comments

Hello,

I have this struct with the following JSON annotations:

MyFancyStruct struct {
	SomeNestedProperty []map[string]interface{} `json:"someNestedProperty,omitempty,nocopy"`
}

And this JSONPath:

$.someNestedProperty[*][*].some_other_prop

If I do the following:

JSONPathResults, err := jsonpath.Get("$.someNestedProperty[*][*].some_other_prop", myFancyStructInstance)

It won't find anything for obvious reasons, because it's searching for someNestedProperty on the struct with the first letter of the property uppercase.

🤔 Is it possible to enforce honoring JSON annotations? Please excuse my ignorance for not diving right into the code.

catalin-me avatar Apr 14 '21 06:04 catalin-me