Skip to content

Added ANTLR. Fix Issue #20960#21230

Merged
wing328 merged 4 commits intoOpenAPITools:masterfrom
DavidGrath:issue-20960
May 11, 2025
Merged

Added ANTLR. Fix Issue #20960#21230
wing328 merged 4 commits intoOpenAPITools:masterfrom
DavidGrath:issue-20960

Conversation

@DavidGrath
Copy link
Copy Markdown
Contributor

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in Git BASH)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

I'm taking inspiration from #3715 by @sullis and #11738 by @borsch to try and add parsing utilities for Kotlin and possibly other languages. For now, though, it's just to fix this issue.
Kotlin Grammar gotten from https://github.com/antlr/grammars-v4

@4brunu, please help review

@wing328
Copy link
Copy Markdown
Member

wing328 commented May 7, 2025

thanks for the PR

please review the build failure when you've time

Comment thread modules/openapi-generator/pom.xml Outdated
</executions>
<configuration>
<sourceDirectory>${basedir}/src/test/antlr4</sourceDirectory>
<libDirectory>${basedir}/src/test/antlr4/imports</libDirectory>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about using spaces instead of tabs?

shall we fix the javadoc issue instead of excluding these from the tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Day,
I'm not sure what you mean exactly, so please can you help me to clarify?
My main issue comes from the fact that it seems the JavaDoc plugin doesn't recognize the ANTLR packages because the dependency is in test scope.
Are you saying that instead of excluding the generated files from scanning, I should find a way to let them be scanned without also causing classpath issues?
Also, sorry about the inconsistent whitespace, I'll fix it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main issue comes from the fact that it seems the JavaDoc plugin doesn't recognize the ANTLR packages because the dependency is in test scope.

👌

please ignore my comment on that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Tabs removed from the pom files

@wing328
Copy link
Copy Markdown
Member

wing328 commented May 11, 2025

thanks for the PR

let's give it a try

cc @OpenAPITools/generator-core-team

@wing328 wing328 merged commit 2fd1ee6 into OpenAPITools:master May 11, 2025
15 checks passed
@DavidGrath
Copy link
Copy Markdown
Contributor Author

Thank you

@wing328 wing328 added this to the 7.14.0 milestone Jun 19, 2025
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.

2 participants