-
-
Notifications
You must be signed in to change notification settings - Fork 135
/
openapi
executable file
·55 lines (49 loc) · 1019 Bytes
/
openapi
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
#!/bin/bash
usage() {
cat <<EOF
Run operations on OpenAPI service.
Usage:
$0 <command>
Commands:
generate Run generation of all OpenAPI from instances
Options:
--help Display this help message
EOF
exit 1
}
generate() {
option=$1
case $option in
-h|--help)
echo "Usage: $0 generate"
echo "Generate a typescript from the OpenAPI spec"
return
;;
esac
./bin/docker-compose \
exec ui \
openapi-generator-cli generate \
--skip-validate-spec \
-i http://openapi:8080/openapi.json \
-g typescript-axios \
-o /src/src/api/client
}
main() {
command=$1
case $command in
generate)
shift
$command $@
exit $?
;;
-h|--help)
usage
return
;;
*)
echo "$command is not a valid command"
usage
exit 1
esac
}
main $@