Skip to content

Commit ec782b2

Browse files
committed
Swagger notice
1 parent b9a5f0e commit ec782b2

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

docs/api/files.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ curl -X POST http://coder-server:8080/api/v2/files \
1616

1717
`POST /files`
1818

19-
Swagger notice: Swagger 2.0 doesn't support file upload with a `content-type` different than `application/x-www-form-urlencoded`.
20-
2119
> Body parameter
2220
2321
```yaml

scripts/apidocgen/markdown-template/operation.dot

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
{{
22
function renderCodeSample(data) {
33
const originalCodeSample = data.utils.getCodeSamples(data);
4-
return originalCodeSample.replace("\n```\n", "```\n")
4+
return originalCodeSample.replace("\n```\n", "```\n");
5+
}
6+
7+
function renderDescription(data) {
8+
if (!data.operation.description) {
9+
return "";
10+
}
11+
if (data.operation.description.startsWith("Swagger notice:")) {
12+
return "";
13+
}
14+
return data.operation.description;
515
}
616
}}
717
{{= data.tags.section }}
@@ -27,7 +37,7 @@
2737

2838
{{? data.operation.summary && !data.options.tocSummary}}*{{= data.operation.summary }}*{{?}}
2939

30-
{{? data.operation.description}}{{= data.operation.description }}{{?}}
40+
{{= renderDescription(data)}}
3141

3242
{{? data.operation.requestBody}}
3343
> Body parameter

0 commit comments

Comments
 (0)