Skip to content

Commit d6e5207

Browse files
committed
empty endpoint
1 parent 8c770ff commit d6e5207

File tree

5 files changed

+207
-0
lines changed

5 files changed

+207
-0
lines changed

coderd/apidoc/docs.go

Lines changed: 64 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 56 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/coderd.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,10 @@ func New(options *Options) *API {
562562
r.Get("/", api.templateVersion)
563563
r.Patch("/", api.patchTemplateVersion)
564564
r.Patch("/cancel", api.patchCancelTemplateVersion)
565+
// Old agents may expect a non-error response from /schema and /parameters endpoints.
566+
// The idea is to return an empty [], so that the coder CLI won't get blocked accidentally.
567+
r.Get("/schema", api.templateVersionSchemaDeprecated)
568+
r.Get("/parameters", api.templateVersionParametersDeprecated)
565569
r.Get("/rich-parameters", api.templateVersionRichParameters)
566570
r.Get("/gitauth", api.templateVersionGitAuth)
567571
r.Get("/variables", api.templateVersionVariables)

coderd/deprecated.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package coderd
2+
3+
import (
4+
"net/http"
5+
6+
"github.com/coder/coder/coderd/httpapi"
7+
)
8+
9+
// @Summary Removed: Get parameters by template version
10+
// @ID get-parameters-by-template-version
11+
// @Security CoderSessionToken
12+
// @Produce json
13+
// @Tags Templates
14+
// @Param templateversion path string true "Template version ID" format(uuid)
15+
// @Success 200
16+
// @Router /templateversions/{templateversion}/parameters [get]
17+
func (api *API) templateVersionParametersDeprecated(rw http.ResponseWriter, r *http.Request) {
18+
httpapi.Write(r.Context(), rw, http.StatusOK, []struct{}{})
19+
}
20+
21+
// @Summary Removed: Get schema by template version
22+
// @ID get-schema-by-template-version
23+
// @Security CoderSessionToken
24+
// @Produce json
25+
// @Tags Templates
26+
// @Param templateversion path string true "Template version ID" format(uuid)
27+
// @Success 200
28+
// @Router /templateversions/{templateversion}/schema [get]
29+
func (api *API) templateVersionSchemaDeprecated(rw http.ResponseWriter, r *http.Request) {
30+
httpapi.Write(r.Context(), rw, http.StatusOK, []struct{}{})
31+
}

docs/api/templates.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,6 +1921,32 @@ Status Code **200**
19211921

19221922
To perform this operation, you must be authenticated. [Learn more](authentication.md).
19231923

1924+
## Removed: Get parameters by template version
1925+
1926+
### Code samples
1927+
1928+
```shell
1929+
# Example request using curl
1930+
curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/parameters \
1931+
-H 'Coder-Session-Token: API_KEY'
1932+
```
1933+
1934+
`GET /templateversions/{templateversion}/parameters`
1935+
1936+
### Parameters
1937+
1938+
| Name | In | Type | Required | Description |
1939+
| ----------------- | ---- | ------------ | -------- | ------------------- |
1940+
| `templateversion` | path | string(uuid) | true | Template version ID |
1941+
1942+
### Responses
1943+
1944+
| Status | Meaning | Description | Schema |
1945+
| ------ | ------------------------------------------------------- | ----------- | ------ |
1946+
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | |
1947+
1948+
To perform this operation, you must be authenticated. [Learn more](authentication.md).
1949+
19241950
## Get resources by template version
19251951

19261952
### Code samples
@@ -2236,6 +2262,32 @@ Status Code **200**
22362262

22372263
To perform this operation, you must be authenticated. [Learn more](authentication.md).
22382264

2265+
## Removed: Get schema by template version
2266+
2267+
### Code samples
2268+
2269+
```shell
2270+
# Example request using curl
2271+
curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/schema \
2272+
-H 'Coder-Session-Token: API_KEY'
2273+
```
2274+
2275+
`GET /templateversions/{templateversion}/schema`
2276+
2277+
### Parameters
2278+
2279+
| Name | In | Type | Required | Description |
2280+
| ----------------- | ---- | ------------ | -------- | ------------------- |
2281+
| `templateversion` | path | string(uuid) | true | Template version ID |
2282+
2283+
### Responses
2284+
2285+
| Status | Meaning | Description | Schema |
2286+
| ------ | ------------------------------------------------------- | ----------- | ------ |
2287+
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | |
2288+
2289+
To perform this operation, you must be authenticated. [Learn more](authentication.md).
2290+
22392291
## Get template variables by template version
22402292

22412293
### Code samples

0 commit comments

Comments
 (0)