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

API docs, /stacks?filters= #2751

Closed
till opened this issue Mar 4, 2019 · 1 comment
Closed

API docs, /stacks?filters= #2751

till opened this issue Mar 4, 2019 · 1 comment

Comments

@till
Copy link

till commented Mar 4, 2019

Bug description

According to the API docs (on Swaggerhub), the parameter filters is a map[string]string, but that's not the case:

Error: Invalid query parameter: filters
Status Code 400
Details: json: cannot unmarshal string into Go struct field stackListOperationFilters.EndpointID of type int

See this line:

type stackListOperationFilters struct {
SwarmID string `json:"SwarmID"`
EndpointID int `json:"EndpointID"`
}

Should be updated that filters is of type stackListOperationFilters. And that should be included on SwaggerHub.

@deviantony deviantony added this to the next milestone Mar 4, 2019
@deviantony deviantony removed this from the next milestone Oct 31, 2019
@deviantony deviantony self-assigned this Oct 31, 2019
@deviantony deviantony removed their assignment Oct 31, 2019
@deviantony
Copy link
Member

Closing this issue as the documentation provides the correct way to pass the filters to the stackList operation.

The filters must be specified as JSON using your API client tool. Here is an example with httpie:

http GET :9000/api/stacks "Authorization: ${jwt}" filters:='{"EndpointID":1}'     
HTTP/1.1 200 OK
Content-Length: 3
Content-Type: application/json
Date: Thu, 31 Oct 2019 22:01:11 GMT
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block

[]

An object is pretty much a map (or a dictionary) in JSON.

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

2 participants