Skip to content

Commit b53fb01

Browse files
committed
add generate-html
1 parent 82cc479 commit b53fb01

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
generated/
22
openapi.yaml
3+
html

helper.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66

77

88
# the docker image used to generate the client code
9-
docker_image="swaggerapi/swagger-codegen-cli-v3"
9+
docker_image="swaggerapi/swagger-codegen-cli-v3:3.0.41"
1010
# where to grab the definition file
1111
openapi_yaml_url="https://raw.githubusercontent.com/elabftw/elabftw/hypernext/apidoc/v2/openapi.yaml"
1212
# folder with the generated python code
1313
lib="generated"
14+
html="html"
1415

1516
function cleanup {
1617
rm -rfv "$lib"
18+
rm -rfv "$html"
1719
}
1820

1921
# generate the lib from remote hypernext spec
@@ -22,6 +24,11 @@ function generate {
2224
docker run --user "$(id -u)":"$(id -gn)" --rm -v "${PWD}":/local "$docker_image" generate -i "$openapi_yaml_url" -l python -o /local/"$lib" -c /local/config.json --git-user-id elabftw --git-repo-id elabapi-python
2325
}
2426

27+
function generate-html {
28+
cleanup
29+
docker run --user "$(id -u)":"$(id -gn)" --rm -v "${PWD}":/local "$docker_image" generate -i "$openapi_yaml_url" -l html2 -o /local/"$html" -c /local/config.json --git-user-id elabftw --git-repo-id elabapi-python
30+
}
31+
2532
# don't use user/group ids in GH actions
2633
function generate-ci {
2734
docker run --rm -v "${PWD}":/local "$docker_image" generate -i "$openapi_yaml_url" -l python -o /local/"$lib" -c /local/config.json --git-user-id elabftw --git-repo-id elabapi-python

0 commit comments

Comments
 (0)