Skip to content

Commit 484f1e9

Browse files
committed
WIP
1 parent bd6ed04 commit 484f1e9

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ gen: \
401401
provisionerd/proto/provisionerd.pb.go \
402402
site/src/api/typesGenerated.ts \
403403
docs/admin/prometheus.md \
404-
$(wildcard coderd/apidocgen/*)
404+
coderd/apidocs $(wildcard coderd/apidocgen/*)
405405
.PHONY: gen
406406

407407
# Mark all generated files as fresh so make thinks they're up-to-date. This is

coderd/apidocs/docs.go

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@ const docTemplate = `{
1010
"info": {
1111
"description": "{{escape .Description}}",
1212
"title": "{{.Title}}",
13-
"contact": {},
13+
"termsOfService": "https://coder.com/legal/terms-of-service",
14+
"contact": {
15+
"name": "API Support",
16+
"url": "http://coder.com",
17+
"email": "support@coder.com"
18+
},
19+
"license": {
20+
"name": "AGPL-3.0",
21+
"url": "https://github.com/coder/coder/blob/main/LICENSE"
22+
},
1423
"version": "{{.Version}}"
1524
},
1625
"host": "{{.Host}}",
@@ -20,12 +29,12 @@ const docTemplate = `{
2029

2130
// SwaggerInfo holds exported Swagger Info so clients can modify it
2231
var SwaggerInfo = &swag.Spec{
23-
Version: "",
24-
Host: "",
25-
BasePath: "",
32+
Version: "1.0",
33+
Host: "dev.coder.com",
34+
BasePath: "/v2",
2635
Schemes: []string{},
27-
Title: "",
28-
Description: "",
36+
Title: "Coder API",
37+
Description: "Coderd API",
2938
InfoInstanceName: "swagger",
3039
SwaggerTemplate: docTemplate,
3140
}

coderd/apidocs/swagger.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
{
22
"swagger": "2.0",
33
"info": {
4-
"contact": {}
4+
"description": "Coderd API",
5+
"title": "Coder API",
6+
"termsOfService": "https://coder.com/legal/terms-of-service",
7+
"contact": {
8+
"name": "API Support",
9+
"url": "http://coder.com",
10+
"email": "support@coder.com"
11+
},
12+
"license": {
13+
"name": "AGPL-3.0",
14+
"url": "https://github.com/coder/coder/blob/main/LICENSE"
15+
},
16+
"version": "1.0"
517
},
18+
"host": "dev.coder.com",
19+
"basePath": "/v2",
620
"paths": {}
721
}

0 commit comments

Comments
 (0)