36
36
37
37
# swagger.yamlを修正したいときがあるので、
38
38
if " ${FLAG_DOWNLOAD} " ; then
39
- curl https://annofab.com/docs/api/swagger.yaml --output swagger.yaml
40
- curl https://annofab.com/docs/api/swagger.v2.yaml --output swagger.v2.yaml
41
- curl https://annofab.com/docs/api/swagger-api-components.yaml --output swagger-api-components.yaml
39
+ curl https://annofab.com/docs/api/swagger.yaml --output swagger/swagger.yaml
40
+ curl https://annofab.com/docs/api/swagger.v2.yaml --output swagger/swagger.v2.yaml
41
+ curl https://annofab.com/docs/api/swagger-api-components.yaml --output swagger/swagger-api-components.yaml
42
+ # curl https://annofab.com/docs/api/swagger.internal.yaml --output swagger.internal.yaml
42
43
43
44
# インデントを1つ深くする
44
- sed -e " s/#\/schemas/#\/components\/schemas/g" -e " s/^/ /g" swagger-api-components.yaml --in-place
45
+ sed -e " s/#\/schemas/#\/components\/schemas/g" -e " s/^/ /g" swagger/swagger -api-components.yaml --in-place
45
46
46
- sed ' /swagger-api-components.yaml/d' swagger.yaml > swagger-tmp.yaml
47
- cat swagger-tmp.yaml swagger-api-components.yaml > swagger.yaml
47
+ sed ' /swagger-api-components.yaml/d' swagger/swagger .yaml > swagger/ swagger-tmp.yaml
48
+ cat swagger/swagger -tmp.yaml swagger/swagger -api-components.yaml > swagger/ swagger.yaml
48
49
49
- sed ' /swagger-api-components.yaml/d' swagger.v2.yaml > swagger-tmp.v2.yaml
50
- cat swagger-tmp.v2.yaml swagger-api-components.yaml > swagger.v2.yaml
50
+ sed ' /swagger-api-components.yaml/d' swagger/swagger .v2.yaml > swagger/ swagger-tmp.v2.yaml
51
+ cat swagger/swagger -tmp.v2.yaml swagger/swagger -api-components.yaml > swagger/ swagger.v2.yaml
51
52
52
- rm swagger-tmp.yaml swagger-tmp.v2.yaml
53
+ rm swagger/swagger -tmp.yaml swagger/ swagger-tmp.v2.yaml
53
54
fi
54
55
55
56
JAVA_OPTS=" -Dlog.level=info"
@@ -60,7 +61,7 @@ OPENAPI_GENERATOR_CLI_COMMON_OPTION="--generator-name python \
60
61
61
62
# v1 apiを生成
62
63
docker run --rm -u ` id -u` :` id -g` -v ${PWD} :/local -w /local -e JAVA_OPTS=${JAVA_OPTS} openapitools/openapi-generator-cli generate \
63
- --input-spec swagger.yaml \
64
+ --input-spec swagger/swagger .yaml \
64
65
${OPENAPI_GENERATOR_CLI_COMMON_OPTION} \
65
66
--template-dir /local/template \
66
67
-Dapis -DapiTests=false -DapiDocs=false \
@@ -75,7 +76,7 @@ rm -Rf out/openapi_client
75
76
76
77
# v2 apiを生成
77
78
docker run --rm -u ` id -u` :` id -g` -v ${PWD} :/local -w /local -e JAVA_OPTS=${JAVA_OPTS} openapitools/openapi-generator-cli generate \
78
- --input-spec swagger.v2.yaml \
79
+ --input-spec swagger/swagger .v2.yaml \
79
80
${OPENAPI_GENERATOR_CLI_COMMON_OPTION} \
80
81
--template-dir /local/template \
81
82
-Dapis -DapiTests=false -DapiDocs=false \
@@ -88,7 +89,7 @@ rm -Rf out/openapi_client
88
89
# v1 apiのmodelからDataClass用のpythonファイルを生成する。
89
90
docker run --rm -u ` id -u` :` id -g` -v ${PWD} :/local -w /local -e JAVA_OPTS=${JAVA_OPTS} \
90
91
openapitools/openapi-generator-cli generate \
91
- --input-spec swagger.yaml \
92
+ --input-spec swagger/swagger .yaml \
92
93
${OPENAPI_GENERATOR_CLI_COMMON_OPTION} \
93
94
--template-dir /local/template_dataclass \
94
95
-Dmodels -DmodelTests=false -DmodelDocs=false \
0 commit comments