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

Deleting a non-empty Workspace fails with bad error message #461

Open
mchlumsky opened this issue Aug 6, 2024 · 0 comments
Open

Deleting a non-empty Workspace fails with bad error message #461

mchlumsky opened this issue Aug 6, 2024 · 0 comments

Comments

@mchlumsky
Copy link

When deleting a workspace that is not empty, the response returned is a 400 and the message in the response isn't parsed correctly.

Example: the body of the response is:
{"message":{"message":"Workspace is not empty","entities":{"plugins":224,"services":2,"routes":60,"audit_requests":1}}}

Expected:

workspaceService.Delete(ctx, &workspaceName) should return an error explaining the Workspace is not empty

Actual:
workspaceService.Delete(ctx, &workspaceName) returns an error that looks like this:

HTTP status 400 (message: \"<failed to parse response body: json: cannot unmarshal object into Go struct field .Message of type string>\")

Using github.com/kong/go-kong v0.55.0 with Kong Enterprise version 3.0.2.0

Extra information: I'm pretty sure the problem comes from here. The struct doesn't match the response body.

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