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.
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 emptyActual:
workspaceService.Delete(ctx, &workspaceName)
returns an error that looks like this:Using
github.com/kong/go-kong v0.55.0
with Kong Enterprise version 3.0.2.0Extra information: I'm pretty sure the problem comes from here. The struct doesn't match the response body.