-
Notifications
You must be signed in to change notification settings - Fork 627
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
Bug: Typedapi Nodes.Info().Do() returns json unmarshalling error. #911
Comments
It looks like it is the NodesInfoPath struct in types.nodeinfopath.go, at least that is one place, where it seems to be incorrect. type NodeInfoPath struct {
Data []string `json:"data,omitempty"`
Home *string `json:"home,omitempty"`
Logs *string `json:"logs,omitempty"`
Repo []string `json:"repo,omitempty"`
} While the API returns: "path": {
"data": "/srv/elasticsearch",
"logs": "/var/log/elasticsearch/xyz",
"home": "/usr/share/elasticsearch" |
In my case changing this definition resolves the error and my api seems to never return an array of strings. // NodeInfoPath type.
//
// https://github.com/elastic/elasticsearch-specification/blob/19027dbdd366978ccae41842a040a636730e7c10/specification/nodes/info/types.ts#L158-L163
type NodeInfoPath struct {
Data string `json:"data,omitempty"`
Home *string `json:"home,omitempty"`
Logs *string `json:"logs,omitempty"`
Repo []string `json:"repo,omitempty"`
} But one could also use a custom Type |
Thank you for reporting this, I've found evidence of I'll open a PR on the specification to fix this. |
Hey,
when using the typed api client like this:
i get the following error:
I couldn't exactly track down which specific field causes the error.
Edit: I used the filter_path incorrectly and removed the part. The main issue is that the json response cannot be unmarshalled into the info.Response struct anyways.
The text was updated successfully, but these errors were encountered: