Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

Commit 6c7dd4a

Browse files
committed
support scripts simplified
1 parent 6fe40e9 commit 6c7dd4a

5 files changed

Lines changed: 11 additions & 9 deletions

File tree

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ testpub:
2323
schema:
2424
curl "https://demo.defectdojo.org/api/v2/oa3/schema/?format=json" -o support/openapi.json
2525

26-
generate:
26+
templates:
2727
./support/api_generation/dump_templates.sh
28+
29+
generate:
2830
./support/api_generation/generate.sh
2931
$(MAKE) lint

support/api_generation/config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
generatorName: python
2-
templateDir: local/support/api_generation/templates.spec
2+
templateDir: support/api_generation/custom_templates
33
additionalProperties:
44
generateSourceCodeOnly: true
55
packageName: defectdojo_api_generated
6+
packageUrl: https://github.com/fopina/defectdojo-api-generated
7+
projectName: defectdojo-api-generated
68
globalProperties:
79
modelDocs: false
810
apiDocs: false

support/api_generation/dump_templates.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ rm -fr $TEMPDIR
1313

1414
./support/api_generation/openapi-generator-cli.sh author template \
1515
-g python \
16-
--output /local/$TEMPDIR
16+
--output $TEMPDIR

support/api_generation/generate.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,18 @@
22

33
set -eo pipefail
44

5-
OPENAPI_PATH=${OPENAPI_PATH:-"/local/support/openapi.json"}
5+
OPENAPI_PATH=${OPENAPI_PATH:-"support/openapi.json"}
66

77
# make sure we're on root dir
88
cd $(dirname $0)
99
cd ..
1010
cd ..
1111

12-
# add custom templates to full templates
13-
cp -r ./support/api_generation/custom_templates/ ./support/api_generation/templates.spec/
1412
./support/api_generation/openapi-generator-cli.sh \
1513
generate \
1614
-i "${OPENAPI_PATH}" \
17-
-c /local/support/api_generation/config.yaml \
18-
-o /local/
15+
-c support/api_generation/config.yaml \
16+
-o .
1917

2018
rm -fr tests/generated
2119
mv defectdojo_api_generated/test tests/generated

support/api_generation/openapi-generator-cli.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ IMAGE=${OPENAPITOOLS_IMAGE:-openapitools/openapi-generator-cli:v7.13.0}
44

55
VOL=$(cd $(dirname $0); cd ..; cd ..; pwd)
66

7-
docker run --rm -e https_proxy -e http_proxy -e no_proxy -v $VOL:/local $IMAGE "$@"
7+
docker run --rm -e https_proxy -e http_proxy -e no_proxy -v $VOL:$VOL -w $PWD $IMAGE "$@"

0 commit comments

Comments
 (0)