Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2063d0c

Browse files
committed
fix: 201
1 parent 934257f commit 2063d0c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

coderd/apidoc/docs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,8 @@ const docTemplate = `{
644644
}
645645
],
646646
"responses": {
647-
"200": {
648-
"description": "OK",
647+
"201": {
648+
"description": "Created",
649649
"schema": {
650650
"$ref": "#/definitions/codersdk.Parameter"
651651
}

coderd/apidoc/swagger.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,8 @@
554554
}
555555
],
556556
"responses": {
557-
"200": {
558-
"description": "OK",
557+
"201": {
558+
"description": "Created",
559559
"schema": {
560560
"$ref": "#/definitions/codersdk.Parameter"
561561
}

coderd/parameters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
// @Param request body codersdk.CreateParameterRequest true "Parameter request"
2828
// @Param scope path string true "Scope" Enums(template,workspace,import_job)
2929
// @Param id path string true "ID" format(uuid)
30-
// @Success 200 {object} codersdk.Parameter
30+
// @Success 201 {object} codersdk.Parameter
3131
// @Router /parameters/{scope}/{id} [post]
3232
func (api *API) postParameter(rw http.ResponseWriter, r *http.Request) {
3333
ctx := r.Context()

docs/api/parameters.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ curl -X POST http://coder-server:8080/api/v2/parameters/{scope}/{id} \
130130

131131
### Example responses
132132

133-
> 200 Response
133+
> 201 Response
134134
135135
```json
136136
{
@@ -147,9 +147,9 @@ curl -X POST http://coder-server:8080/api/v2/parameters/{scope}/{id} \
147147

148148
### Responses
149149

150-
| Status | Meaning | Description | Schema |
151-
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------- |
152-
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Parameter](schemas.md#codersdkparameter) |
150+
| Status | Meaning | Description | Schema |
151+
| ------ | ------------------------------------------------------------ | ----------- | -------------------------------------------------- |
152+
| 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.Parameter](schemas.md#codersdkparameter) |
153153

154154
To perform this operation, you must be authenticated by means of one of the following methods: **CoderSessionToken**.
155155

0 commit comments

Comments
 (0)