Ask Your Question
2

Can Swagger-codegen be used to produce source code using Jakarta instead of Javavax?

asked 2023-07-01 12:25:53 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-07-01 12:43:02 +0000

bukephalos gravatar image

Yes, Swagger-codegen can be configured to use Jakarta libraries instead of Javavax. You can update the Maven or Gradle dependencies to use the Jakarta libraries and specify the appropriate generator option (-g flag) when running Swagger-codegen.

For example, if you want to generate Java server code using Jakarta libraries, you can use the following command:

java -jar swagger-codegen-cli.jar generate -i <swagger-file> -l java --library jakarta-resteasy -o <output-directory>

This will generate Java source code using the Jakarta RESTEasy library instead of the default JAX-RS library. You can find more information about configuring Swagger-codegen to use Jakarta libraries in the official documentation.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-01 12:25:53 +0000

Seen: 11 times

Last updated: Jul 01 '23