Skip to content

Commit 6309f07

Browse files
committed
Fix: mention only HTTP 200
1 parent 83aa9d3 commit 6309f07

File tree

7 files changed

+12
-261
lines changed

7 files changed

+12
-261
lines changed

coderd/apidoc/docs.go

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,6 @@ const docTemplate = `{
6464
"schema": {
6565
"$ref": "#/definitions/codersdk.Template"
6666
}
67-
},
68-
"404": {
69-
"description": "Not Found",
70-
"schema": {
71-
"$ref": "#/definitions/codersdk.Response"
72-
}
73-
},
74-
"500": {
75-
"description": "Internal Server Error",
76-
"schema": {
77-
"$ref": "#/definitions/codersdk.Response"
78-
}
7967
}
8068
}
8169
}
@@ -111,18 +99,6 @@ const docTemplate = `{
11199
"schema": {
112100
"$ref": "#/definitions/codersdk.Template"
113101
}
114-
},
115-
"404": {
116-
"description": "Not Found",
117-
"schema": {
118-
"$ref": "#/definitions/codersdk.Response"
119-
}
120-
},
121-
"500": {
122-
"description": "Internal Server Error",
123-
"schema": {
124-
"$ref": "#/definitions/codersdk.Response"
125-
}
126102
}
127103
}
128104
}
@@ -197,18 +173,6 @@ const docTemplate = `{
197173
"schema": {
198174
"$ref": "#/definitions/codersdk.WorkspacesResponse"
199175
}
200-
},
201-
"400": {
202-
"description": "Bad Request",
203-
"schema": {
204-
"$ref": "#/definitions/codersdk.Response"
205-
}
206-
},
207-
"500": {
208-
"description": "Internal Server Error",
209-
"schema": {
210-
"$ref": "#/definitions/codersdk.Response"
211-
}
212176
}
213177
}
214178
}
@@ -250,30 +214,6 @@ const docTemplate = `{
250214
"schema": {
251215
"$ref": "#/definitions/codersdk.Workspace"
252216
}
253-
},
254-
"400": {
255-
"description": "Bad Request",
256-
"schema": {
257-
"$ref": "#/definitions/codersdk.Response"
258-
}
259-
},
260-
"404": {
261-
"description": "Not Found",
262-
"schema": {
263-
"$ref": "#/definitions/codersdk.Response"
264-
}
265-
},
266-
"410": {
267-
"description": "Gone",
268-
"schema": {
269-
"$ref": "#/definitions/codersdk.Response"
270-
}
271-
},
272-
"500": {
273-
"description": "Internal Server Error",
274-
"schema": {
275-
"$ref": "#/definitions/codersdk.Response"
276-
}
277217
}
278218
}
279219
}
@@ -435,26 +375,6 @@ const docTemplate = `{
435375
}
436376
}
437377
},
438-
"codersdk.Response": {
439-
"type": "object",
440-
"properties": {
441-
"detail": {
442-
"description": "Detail is a debug message that provides further insight into why the\naction failed. This information can be technical and a regular golang\nerr.Error() text.\n- \"database: too many open connections\"\n- \"stat: too many open files\"",
443-
"type": "string"
444-
},
445-
"message": {
446-
"description": "Message is an actionable message that depicts actions the request took.\nThese messages should be fully formed sentences with proper punctuation.\nExamples:\n- \"A user has been created.\"\n- \"Failed to create a user.\"",
447-
"type": "string"
448-
},
449-
"validations": {
450-
"description": "Validations are form field-specific friendly error messages. They will be\nshown on a form field in the UI. These can also be used to add additional\ncontext if there is a set of errors in the primary 'Message'.",
451-
"type": "array",
452-
"items": {
453-
"$ref": "#/definitions/codersdk.ValidationError"
454-
}
455-
}
456-
}
457-
},
458378
"codersdk.Template": {
459379
"type": "object",
460380
"properties": {
@@ -529,21 +449,6 @@ const docTemplate = `{
529449
}
530450
}
531451
},
532-
"codersdk.ValidationError": {
533-
"type": "object",
534-
"required": [
535-
"detail",
536-
"field"
537-
],
538-
"properties": {
539-
"detail": {
540-
"type": "string"
541-
},
542-
"field": {
543-
"type": "string"
544-
}
545-
}
546-
},
547452
"codersdk.Workspace": {
548453
"type": "object",
549454
"properties": {

coderd/apidoc/swagger.json

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,6 @@
5656
"schema": {
5757
"$ref": "#/definitions/codersdk.Template"
5858
}
59-
},
60-
"404": {
61-
"description": "Not Found",
62-
"schema": {
63-
"$ref": "#/definitions/codersdk.Response"
64-
}
65-
},
66-
"500": {
67-
"description": "Internal Server Error",
68-
"schema": {
69-
"$ref": "#/definitions/codersdk.Response"
70-
}
7159
}
7260
}
7361
}
@@ -103,18 +91,6 @@
10391
"schema": {
10492
"$ref": "#/definitions/codersdk.Template"
10593
}
106-
},
107-
"404": {
108-
"description": "Not Found",
109-
"schema": {
110-
"$ref": "#/definitions/codersdk.Response"
111-
}
112-
},
113-
"500": {
114-
"description": "Internal Server Error",
115-
"schema": {
116-
"$ref": "#/definitions/codersdk.Response"
117-
}
11894
}
11995
}
12096
}
@@ -189,18 +165,6 @@
189165
"schema": {
190166
"$ref": "#/definitions/codersdk.WorkspacesResponse"
191167
}
192-
},
193-
"400": {
194-
"description": "Bad Request",
195-
"schema": {
196-
"$ref": "#/definitions/codersdk.Response"
197-
}
198-
},
199-
"500": {
200-
"description": "Internal Server Error",
201-
"schema": {
202-
"$ref": "#/definitions/codersdk.Response"
203-
}
204168
}
205169
}
206170
}
@@ -242,30 +206,6 @@
242206
"schema": {
243207
"$ref": "#/definitions/codersdk.Workspace"
244208
}
245-
},
246-
"400": {
247-
"description": "Bad Request",
248-
"schema": {
249-
"$ref": "#/definitions/codersdk.Response"
250-
}
251-
},
252-
"404": {
253-
"description": "Not Found",
254-
"schema": {
255-
"$ref": "#/definitions/codersdk.Response"
256-
}
257-
},
258-
"410": {
259-
"description": "Gone",
260-
"schema": {
261-
"$ref": "#/definitions/codersdk.Response"
262-
}
263-
},
264-
"500": {
265-
"description": "Internal Server Error",
266-
"schema": {
267-
"$ref": "#/definitions/codersdk.Response"
268-
}
269209
}
270210
}
271211
}
@@ -427,26 +367,6 @@
427367
}
428368
}
429369
},
430-
"codersdk.Response": {
431-
"type": "object",
432-
"properties": {
433-
"detail": {
434-
"description": "Detail is a debug message that provides further insight into why the\naction failed. This information can be technical and a regular golang\nerr.Error() text.\n- \"database: too many open connections\"\n- \"stat: too many open files\"",
435-
"type": "string"
436-
},
437-
"message": {
438-
"description": "Message is an actionable message that depicts actions the request took.\nThese messages should be fully formed sentences with proper punctuation.\nExamples:\n- \"A user has been created.\"\n- \"Failed to create a user.\"",
439-
"type": "string"
440-
},
441-
"validations": {
442-
"description": "Validations are form field-specific friendly error messages. They will be\nshown on a form field in the UI. These can also be used to add additional\ncontext if there is a set of errors in the primary 'Message'.",
443-
"type": "array",
444-
"items": {
445-
"$ref": "#/definitions/codersdk.ValidationError"
446-
}
447-
}
448-
}
449-
},
450370
"codersdk.Template": {
451371
"type": "object",
452372
"properties": {
@@ -521,21 +441,6 @@
521441
}
522442
}
523443
},
524-
"codersdk.ValidationError": {
525-
"type": "object",
526-
"required": [
527-
"detail",
528-
"field"
529-
],
530-
"properties": {
531-
"detail": {
532-
"type": "string"
533-
},
534-
"field": {
535-
"type": "string"
536-
}
537-
}
538-
},
539444
"codersdk.Workspace": {
540445
"type": "object",
541446
"properties": {

coderd/templates.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ const (
4141
// @Tags Templates
4242
// @Param id path string true "Template ID" format(uuid)
4343
// @Success 200 {object} codersdk.Template
44-
// @Failure 404 {object} codersdk.Response
45-
// @Failure 500 {object} codersdk.Response
4644
// @Router /templates/{id} [get]
4745
// Returns a single template.
4846
func (api *API) template(rw http.ResponseWriter, r *http.Request) {
@@ -145,8 +143,6 @@ func (api *API) deleteTemplate(rw http.ResponseWriter, r *http.Request) {
145143
// @Param request body codersdk.CreateTemplateRequest true "Request body"
146144
// @Param organization-id path string true "Organization ID"
147145
// @Success 200 {object} codersdk.Template
148-
// @Failure 404 {object} codersdk.Response
149-
// @Failure 500 {object} codersdk.Response
150146
// @Router /organizations/{organization-id}/templates/ [post]
151147
// Returns a single template.
152148
// Create a new template in an organization.

coderd/workspaces.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ var (
5151
// @Param id path string true "Workspace ID" format(uuid)
5252
// @Param include_deleted query string false "Return data instead of HTTP 404 if the workspace is deleted"
5353
// @Success 200 {object} codersdk.Workspace
54-
// @Failure 400 {object} codersdk.Response
55-
// @Failure 404 {object} codersdk.Response
56-
// @Failure 410 {object} codersdk.Response
57-
// @Failure 500 {object} codersdk.Response
5854
// @Router /workspaces/{id} [get]
5955
func (api *API) workspace(rw http.ResponseWriter, r *http.Request) {
6056
ctx := r.Context()
@@ -116,8 +112,6 @@ func (api *API) workspace(rw http.ResponseWriter, r *http.Request) {
116112
// @Param status query string false "Filter by workspace status" Enums(pending,running,stopping,stopped,failed,canceling,canceled,deleted,deleting)
117113
// @Param has_agent query string false "Filter by agent status" Enums(connected,connecting,disconnected,timeout)
118114
// @Success 200 {object} codersdk.WorkspacesResponse
119-
// @Failure 400 {object} codersdk.Response
120-
// @Failure 500 {object} codersdk.Response
121115
// @Router /workspaces [get]
122116
//
123117
// workspaces returns all workspaces a user can read.

docs/api/schemas.md

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -152,29 +152,6 @@
152152
| » **additionalProperties** | string | false | none | none |
153153
| worker_id | string | false | none | none |
154154

155-
## codersdk.Response
156-
157-
```json
158-
{
159-
"detail": "string",
160-
"message": "string",
161-
"validations": [
162-
{
163-
"detail": "string",
164-
"field": "string"
165-
}
166-
]
167-
}
168-
```
169-
170-
### Properties
171-
172-
| Name | Type | Required | Restrictions | Description |
173-
| ----------- | ------ | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
174-
| detail | string | false | none | Detail is a debug message that provides further insight into why the<br>action failed. This information can be technical and a regular golang<br>err.Error() text.<br>- "database: too many open connections"<br>- "stat: too many open files" |
175-
| message | string | false | none | Message is an actionable message that depicts actions the request took.<br>These messages should be fully formed sentences with proper punctuation.<br>Examples:<br>- "A user has been created."<br>- "Failed to create a user." |
176-
| validations | array | false | none | Validations are form field-specific friendly error messages. They will be<br>shown on a form field in the UI. These can also be used to add additional<br>context if there is a set of errors in the primary 'Message'. |
177-
178155
## codersdk.Template
179156

180157
```json
@@ -267,22 +244,6 @@
267244
| p50 | integer | false | none | none |
268245
| p95 | integer | false | none | none |
269246

270-
## codersdk.ValidationError
271-
272-
```json
273-
{
274-
"detail": "string",
275-
"field": "string"
276-
}
277-
```
278-
279-
### Properties
280-
281-
| Name | Type | Required | Restrictions | Description |
282-
| ------ | ------ | -------- | ------------ | ----------- |
283-
| detail | string | true | none | none |
284-
| field | string | true | none | none |
285-
286247
## codersdk.Workspace
287248

288249
```json

docs/api/templates.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,9 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization-id}/tem
8282

8383
### Responses
8484

85-
| Status | Meaning | Description | Schema |
86-
| ------ | -------------------------------------------------------------------------- | --------------------- | ------------------------------------------------ |
87-
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Template](schemas.md#codersdktemplate) |
88-
| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | Not Found | [codersdk.Response](schemas.md#codersdkresponse) |
89-
| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | Internal Server Error | [codersdk.Response](schemas.md#codersdkresponse) |
85+
| Status | Meaning | Description | Schema |
86+
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ |
87+
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Template](schemas.md#codersdktemplate) |
9088

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

@@ -147,10 +145,8 @@ curl -X GET http://coder-server:8080/api/v2/templates/{id} \
147145

148146
### Responses
149147

150-
| Status | Meaning | Description | Schema |
151-
| ------ | -------------------------------------------------------------------------- | --------------------- | ------------------------------------------------ |
152-
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Template](schemas.md#codersdktemplate) |
153-
| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | Not Found | [codersdk.Response](schemas.md#codersdkresponse) |
154-
| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | Internal Server Error | [codersdk.Response](schemas.md#codersdkresponse) |
148+
| Status | Meaning | Description | Schema |
149+
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ |
150+
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Template](schemas.md#codersdktemplate) |
155151

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

0 commit comments

Comments
 (0)