OpenAPI: Fix ValidationError message attribute (#90846)
It's `message`, not `msg`. It's been fixed for a while here: https://github.com/grafana/grafana-openapi-client-go/blob/9ef69836127d783a63b2d0c61b2f8bf3de0c8e86/scripts/pull-schema.sh#L46-L49 I've also reflected the change in the tests
This commit is contained in:
@@ -99,8 +99,10 @@ func TestProvisioningApi(t *testing.T) {
|
||||
response := sut.RoutePutPolicyTree(&rc, tree)
|
||||
|
||||
require.Equal(t, 400, response.Status())
|
||||
expBody := `{"message":"invalid object specification: invalid policy tree"}`
|
||||
require.Equal(t, expBody, string(response.Body()))
|
||||
expBody := definitions.ValidationError{Message: "invalid object specification: invalid policy tree"}
|
||||
expBodyJSON, marshalErr := json.Marshal(expBody)
|
||||
require.NoError(t, marshalErr)
|
||||
require.Equal(t, string(expBodyJSON), string(response.Body()))
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user