OpenAPITools / OpenAPITools/openapi-generator
[REQ] Examples of Using Generated Client from Maven Plugin
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
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:
- https://stackoverflow.com/questions/65576818/how-to-deal-with-dependencies-of-generated-sources-in-maven
- https://stackoverflow.com/questions/73419480/openapi-generator-how-to-import-generated-pom-xml
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:
- Essentially copy the entire contents of
<dependencies>from the generated maven file into the projectpom.xml - 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the generated Maven project and pom.xml under target/generated-sources, then review the linked Stack Overflow questions for the usage problems to address. Document or demonstrate how a project can consume the generated code and its dependencies; done means a newcomer can follow the example without manually guessing how to integrate the generated artifact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100