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.44k stars 6.48k forks source link

[REQ] Examples of Using Generated Client from Maven Plugin #18918

Open SpaceCondor opened 3 months ago

SpaceCondor commented 3 months ago

Is your feature request related to a problem? Please describe.

The maven build plugin generates a full maven project with a pom.xml in the target/generated-sources folder. This has all the dependencies required for utilizing the generated code. But does not install any required dependencies or the artifact/module itself.   It is not clear how to effectively use the generated code from the maven build plugin, and several questions have been asked on StackOverflow about it:

Describe the solution you'd like

Either create documentation for using this generated code, or have some examples of it.

Describe alternatives you've considered

It seems there are two ways people are handling this:

  1. Essentially copy the entire contents of <dependencies> from the generated maven file into the project pom.xml
  2. Use a parent project with the generated code and project code as submodules (I am a bit unclear about how people are accomplishing this)

Ideally either there would be clear documentation or there would be a better way of utilizing the generated code.