diff --git a/docs/swagger.yaml b/docs/swagger.yaml index be1953c..3928939 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -320,6 +320,8 @@ paths: required: true schema: $ref: '#/definitions/model.NewEndpoint' + produces: + - application/json responses: "201": description: Created @@ -384,11 +386,13 @@ paths: required: true schema: $ref: '#/definitions/model.PatchedEndpoint' + produces: + - application/json responses: "200": description: OK schema: - $ref: '#/definitions/model.PatchedEndpoint' + $ref: '#/definitions/model.Endpoint' "400": description: Bad Request "404": diff --git a/internal/handler/endpoint.go b/internal/handler/endpoint.go index 9c5f027..686bd4b 100644 --- a/internal/handler/endpoint.go +++ b/internal/handler/endpoint.go @@ -117,6 +117,7 @@ func (e *Endpoint) list(w http.ResponseWriter, r *http.Request) { // @Summary Create a new endpoint. // @Accept json // @Param payload body model.NewEndpoint true "Endpoint's information" +// @Produce json // @Success 201 {object} model.Endpoint // @Failure 400 // @Failure 500 @@ -184,7 +185,8 @@ func (e *Endpoint) delete(w http.ResponseWriter, r *http.Request) { // @Summary Update the specified endpoint. Omitted or null fields will remain unchanged. // @Param sid path int true "Sid of the endpoint to be updated" // @Param payload body model.PatchedEndpoint true "Endpoint's fields to update" -// @Success 200 {object} model.PatchedEndpoint +// @Produce json +// @Success 200 {object} model.Endpoint // @Failure 400 // @Failure 404 // @Failure 500