OpenAPITools / OpenAPITools/openapi-generator
Question: Best way to document and generate HTML based on OpenAPI annotations programmatically
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Dear all, first of all, many thanks for the nice and helpful tool that you are made.
SITUATION: We need to add API documentation in our project and need to generate that based on only code (if that allows the plugin).
TASK: Generate HTML or PDF API documentation in mvn verify phase based on existing controller code based on openapi annotations springdoc rescource.
ACTIONS: We are using now springdoc-openapi + openapi-generator-maven-plugin pair. After running the instance plugin generates YAML file based on the documents annotations code that could be downloaded and used as a path in the plugin configuration
<inputSpec>${project.basedir}/src/main/resources/static/api.yaml</inputSpec>
RESULT: As a result I was able to get HTML but just based on the existing YAML file.
QUESTION: Is there any better way to generate HTML or pdf (I think you don't have yet a proper generator to support that format yet), just based on code that had the same generated HTML as we had when using the YAML file.
Thanks in advance
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 by reviewing the springdoc-openapi setup and the openapi-generator-maven-plugin configuration, especially the inputSpec path and the mvn verify phase. Determine whether the generated specification can be consumed directly for HTML or PDF output without the intermediate YAML file; done means a documented, reproducible configuration based on controller annotations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi, spring
- Domain
- api, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100