OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.45k stars 6.49k forks source link

[BUG][JAVA][MICROPROFILE] useRuntimeException is ignored #14409

Open ssaip opened 1 year ago

ssaip commented 1 year ago

Bug Report Checklist

Description

When using the java generator with the microprofile library, the useRuntimeException flag is ignored.

openapi-generator version

openapi-generator-cli-7.0.0-20221012.083708-4.jar

OpenAPI declaration file content or url

sample yaml

Generation Details

java -jar openapi-generator-cli-7.0.0-20221012.083708-4.jar generate -g java -i https://raw.githubusercontent.com/ssaip/openapi-generator-java-useRuntimeException/main/src/main/openapi/example.yaml -o C:\temp\ --additional-properties=useRuntimeException=true --library=microprofile

Steps to reproduce

Use the java generator with the microprofile library

Related issues/PRs

-

Suggest a fix

Either do throw a RuntimeException as configured or (even preferable in my use-case) give the option do NOT generate ApiException, ApiExceptionMapper, @RegisterProvider(ApiExceptionMapper.class) altogether.

If this is not desired for microprofile clients, this information should be added to the documentation.

wing328 commented 1 year ago

If this is not desired for microprofile clients, this information should be added to the documentation.

Agreed the doc should be updated on which libraries support this option

May I know if you've time to add useRuntimeException support to the java microprofile client?

I can show you some good starting points.

ssaip commented 1 year ago

sure, https://github.com/OpenAPITools/openapi-generator/pull/14414