mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
OpenAPI: Fix ValidationError message attribute (#90846)
It's `message`, not `msg`. It's been fixed for a while here: 9ef6983612/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)
|
response := sut.RoutePutPolicyTree(&rc, tree)
|
||||||
|
|
||||||
require.Equal(t, 400, response.Status())
|
require.Equal(t, 400, response.Status())
|
||||||
expBody := `{"message":"invalid object specification: invalid policy tree"}`
|
expBody := definitions.ValidationError{Message: "invalid object specification: invalid policy tree"}
|
||||||
require.Equal(t, expBody, string(response.Body()))
|
expBodyJSON, marshalErr := json.Marshal(expBody)
|
||||||
|
require.NoError(t, marshalErr)
|
||||||
|
require.Equal(t, string(expBodyJSON), string(response.Body()))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -4380,7 +4380,7 @@
|
|||||||
},
|
},
|
||||||
"ValidationError": {
|
"ValidationError": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"msg": {
|
"message": {
|
||||||
"example": "error message",
|
"example": "error message",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ type Ack struct{}
|
|||||||
// swagger:model
|
// swagger:model
|
||||||
type ValidationError struct {
|
type ValidationError struct {
|
||||||
// example: error message
|
// example: error message
|
||||||
Msg string `json:"msg"`
|
Message string `json:"message"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// swagger:model
|
// swagger:model
|
||||||
|
|||||||
@@ -4379,7 +4379,7 @@
|
|||||||
},
|
},
|
||||||
"ValidationError": {
|
"ValidationError": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"msg": {
|
"message": {
|
||||||
"example": "error message",
|
"example": "error message",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8013,7 +8013,7 @@
|
|||||||
"ValidationError": {
|
"ValidationError": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"msg": {
|
"message": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"example": "error message"
|
"example": "error message"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21969,7 +21969,7 @@
|
|||||||
"ValidationError": {
|
"ValidationError": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"msg": {
|
"message": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"example": "error message"
|
"example": "error message"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12027,7 +12027,7 @@
|
|||||||
},
|
},
|
||||||
"ValidationError": {
|
"ValidationError": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"msg": {
|
"message": {
|
||||||
"example": "error message",
|
"example": "error message",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user