-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathendpoints.sh
More file actions
executable file
·70 lines (56 loc) · 1.36 KB
/
endpoints.sh
File metadata and controls
executable file
·70 lines (56 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
if [[ "$#" -lt 2 || "$1" == "-h" ]]; then
echo "Usage: $0 [http_type] [dirs...]"
exit 0
fi
for url in ${@:2}
do
mkdir -p $url
touch $url/$1.ftl
cat <<- EOF > $url/$1.ftl
{
<@lib.endpointInfo
id = "ADD_ID"
tag = "ADD_TAG"
desc = "" />
"parameters" : [
<@lib.parameter
name = "id"
location = "path"
type = "string"
required = true
last = true
desc = ""/>
<#assign last = true >
<#include "/lib/commons/pagination-params.ftl" >
],
<@lib.requestBody
mediaType = "application/json"
dto = "_Dto"
examples = ['"example-1": {
"summary": "",
"description": "",
"value": ""
}'] />
"responses" : {
<@lib.response
code = "200"
dto = "ADD_DTO"
array = true
desc = "Request successful."
examples = ['"example-1": {
"summary": "",
"description": "",
"value": ""
}'] />
<@lib.response
code = "400"
dto = "ExceptionDto"
last = true
desc = "Bad Request. See the
[Introduction](${docsUrl}/reference/rest/overview/#error-handling)
for the error response format." />
}
}
EOF
done