Skip to content

RESTWS-980: Initial implementation of OpenAPI Generator Maven Plugin with JavaParser integration #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

capernix
Copy link
Contributor

@capernix capernix commented May 20, 2025

Description of what I changed

Introduced a new OpenAPI Generator Maven Plugin that integrates JavaParser to extract Javadoc from OpenMRS REST resource classes. This initial implementation serves as a proof-of-concept for enhancing OpenAPI documentation with descriptive information from source code.

Key Implementation Details:

  1. Created a custom Maven plugin (openapi-generator-maven-plugin) with JavaParser integration
  2. Implemented source file location logic to find Java classes across module source roots
  3. Added functionality to parse Java source files and extract class-level Javadoc comments
  4. Successfully tested extraction of Javadoc from PatientResource1_8 class
  5. Fixed a Maven build dependency issue by moving the unpack-dependencies goal from generate-resources to prepare-package phase

This implementation provides the foundation for programmatically enhancing API documentation by leveraging the existing Javadoc in the codebase.

PS: I also pushed the code for the schema introspector alongside so the work can be combined in future commits.

image (1)

Issue I worked on

https://openmrs.atlassian.net/browse/RESTWS-980

Checklist: I completed these to help reviewers :)

  • [x] My IDE is configured to follow the code style of this project.

    No? Unsure? -> configure your IDE, format the code and add the changes with git add . && git commit --amend

  • [] I have added tests to cover my changes. (If you refactored
    existing code that was well tested you do not have to add tests)

    No? -> write tests and add them to this commit git add . && git commit --amend

  • [x] I ran mvn clean package right before creating this pull request and
    added all formatting changes to my commit.

    No? -> execute above command

  • [x] All new and existing tests passed.

    No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.

  • [x] My pull request is based on the latest changes of the master branch.

    No? Unsure? -> execute command git pull --rebase upstream master

@capernix capernix marked this pull request as draft May 20, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant