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

Honor JSON annotations #30

Open
catalin-me opened this issue Apr 14, 2021 · 0 comments
Open

Honor JSON annotations #30

catalin-me opened this issue Apr 14, 2021 · 0 comments

Comments

@catalin-me
Copy link

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.

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

1 participant