mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Fixed up a couple of incorrect response codes (#1095)
* Fixed up a couple of incorrect response codes * Standardise all entities on 204 with no return content on successful delete * Fix failing Fn.delete() test
This commit is contained in:
@@ -18,5 +18,5 @@ func (s *Server) handleFnDelete(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusOK, gin.H{"message": "Successfully deleted func"})
|
c.String(http.StatusNoContent, "")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ func TestFnDelete(t *testing.T) {
|
|||||||
expectedError error
|
expectedError error
|
||||||
}{
|
}{
|
||||||
{commonDS, logs.NewMock(), "/v2/fns/missing", "", http.StatusNotFound, models.ErrFnsNotFound},
|
{commonDS, logs.NewMock(), "/v2/fns/missing", "", http.StatusNotFound, models.ErrFnsNotFound},
|
||||||
{commonDS, logs.NewMock(), fmt.Sprintf("/v2/fns/%s", f.ID), "", http.StatusOK, nil},
|
{commonDS, logs.NewMock(), fmt.Sprintf("/v2/fns/%s", f.ID), "", http.StatusNoContent, nil},
|
||||||
} {
|
} {
|
||||||
rnr, cancel := testRunner(t)
|
rnr, cancel := testRunner(t)
|
||||||
srv := testServer(test.ds, &mqs.Mock{}, test.logDB, rnr, ServerTypeFull)
|
srv := testServer(test.ds, &mqs.Mock{}, test.logDB, rnr, ServerTypeFull)
|
||||||
|
|||||||
@@ -16,5 +16,5 @@ func (s *Server) handleTriggerDelete(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusNoContent, nil)
|
c.String(http.StatusNoContent, "")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ paths:
|
|||||||
parameters:
|
parameters:
|
||||||
- $ref: '#/parameters/AppID'
|
- $ref: '#/parameters/AppID'
|
||||||
responses:
|
responses:
|
||||||
200:
|
204:
|
||||||
description: "The Application successfully deleted."
|
description: "Application successfully deleted."
|
||||||
404:
|
404:
|
||||||
description: "Application does not exist."
|
description: "Application does not exist."
|
||||||
schema:
|
schema:
|
||||||
@@ -418,7 +418,7 @@ definitions:
|
|||||||
readOnly: true
|
readOnly: true
|
||||||
config:
|
config:
|
||||||
type: object
|
type: object
|
||||||
description: "Application function configuration, applied to all routes."
|
description: "Application function configuration, applied to all Functions."
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: string
|
type: string
|
||||||
annotations:
|
annotations:
|
||||||
|
|||||||
Reference in New Issue
Block a user