Skip to content

Honor JSON annotations #30

@catalin-me

Description

@catalin-me

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions