Skip to content

Commit

Permalink
fix(type-safe-api): fix openapi code generation with jdk 17
Browse files Browse the repository at this point in the history
Code generation would fail for JDK >11 due to the following issue:

OpenAPITools/openapi-generator#13684

Setting JAVA_OPTS works around this issue, allowing for generation with newer JDKs
  • Loading branch information
cogwirrel committed May 15, 2023
1 parent e3ce593 commit 73b8231
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/type-safe-api/scripts/generators/generate
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ install_packages @openapitools/openapi-generator-cli@2.5.1
# Support a special placeholder of {{src}} in config.yaml to ensure our custom templates get written to the correct folder
sed 's|{{src}}|'"$src_dir"'|g' config.yaml > config.final.yaml

# Workaround for code generation with JDK 11+
# See: https://github.com/OpenAPITools/openapi-generator/issues/13684
export JAVA_OPTS="--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED"

# Generate the client
run_command @openapitools/openapi-generator-cli generate \
--log-to-stderr \
Expand Down

0 comments on commit 73b8231

Please sign in to comment.