Skip to content

Commit

Permalink
Add openAPI generator configuration file
Browse files Browse the repository at this point in the history
Introduces an openapitools.json file to support API generation. Updated dependencies in package-lock.json, including @openapitools/openapi-generator-cli. Modified package.json script for API generation to ensure previous sources are removed before generating new ones. Removed the openapitools.json entry from .gitignore to track the configuration file.
  • Loading branch information
janoliver20 committed Dec 10, 2024
1 parent 210c000 commit 0a4a835
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 40 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ dist-ssr
target/
more-configuration-api-client-ts*
ConfiguratorAPI.yaml
openapitools.json
src/generated-sources
tests/coverage
24 changes: 24 additions & 0 deletions openapitools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.8.0",
"generators": {
"StudyManagerAPI": {
"inputSpec": "openapi/StudyManagerAPI.yaml",
"generatorName": "typescript-axios",
"output": "src/generated-sources/openapi",
"additionalProperties": {
"supportsES6": true,
"withSeparateModelsAndApi": true,
"withInterfaces": true,
"apiPackage": "api",
"modelPackage": "models"
},
"typeMappings": {
"set": "Array"
}
}
}
}
}
76 changes: 39 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"coverage": "vitest --environment jsdom --coverage",
"test:unit": "vitest --environment jsdom",
"test:unit:once": "vitest --environment jsdom run --outputFile.junit=target/testResults.xml --reporter=junit --reporter=default",
"generate:api": "openapi-generator-cli generate -i ./openapi/StudyManagerAPI.yaml -g typescript-axios -o src/generated-sources/openapi --additional-properties=supportsES6=true,withSeparateModelsAndApi=true,withInterfaces=true,apiPackage=api,modelPackage=models --type-mappings=set=Array --custom-generator=./openapi/openapi.generator-6.2.0.jar",
"generate:api": "rm -r -f src/generated-sources && openapi-generator-cli generate",
"license:check": "licensee --production --errors-only",
"license:list": "licensee --production || true"
},
Expand Down Expand Up @@ -45,7 +45,7 @@
"@headlessui/vue": "1.7.22",
"@heroicons/vue": "2.1.5",
"@intlify/unplugin-vue-i18n": "^6.0.0",
"@openapitools/openapi-generator-cli": "2.13.4",
"@openapitools/openapi-generator-cli": "2.13.9",
"@tailwindcss/aspect-ratio": "0.4.2",
"@tailwindcss/forms": "0.5.7",
"@tailwindcss/typography": "0.5.13",
Expand Down

0 comments on commit 0a4a835

Please sign in to comment.