-
Notifications
You must be signed in to change notification settings - Fork 96
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
Initial re-integration of the OpenAPI generator into Micronaut OpenAPI #1040
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit migrates the OpenAPI code generator from the external OpenAPI generator project to this project. A new module named `openapi-generator` depends on OpenAPI generator and replicates features which are currently found in that project. However, there are a few changes: - the build file generation has been removed. Because we're going to integrate this in build tools, it doesn't make sense to generate these. Even if we use it in Micronaut Launch, then it's the responsibility of Launch to generate the files. One drawback is that the user has to figure out which dependencies to add for the client or server, if they use the build tool plugins. - a type-safe API has been introduced to configure options. It is actually hard to figure out all the options we can configure and are relevant to the code, this work is therefore in progress. - the default package for javax annotations was moved to jakarta Test projects are used to make sure that we can generate at least one client and one server, with hardcoded options. We're using generated sources, which are not supposed to be changed by the user. It simulates what the build tool plugins would do, except that these would probably generate sources in different folders based on what we generate.
Rename the package to api and add Api suffix to the interfaces. Their implementations will have the Controller suffix
This commit extends the builder API in order to be able to use custom code generators. This is required whenever the standard code generators are not enough. In this case, the user would have to provide not only the code generator, but also implement a builder to configure the options specific for that code generator.
SonarCloud Quality Gate failed. |
graemerocher
approved these changes
Jun 13, 2023
we missed documentation in this PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit migrates the OpenAPI code generator from the external OpenAPI generator project to this project. A new module named
openapi-generator
depends on OpenAPI generator and replicates features which are currently found in that project. However, there are a few changes:Test projects are used to make sure that we can generate at least one client and one server, with hardcoded options. We're using generated sources, which are not supposed to be changed by the user. It simulates what the build tool plugins would do, except that these would probably generate sources in different folders based on what we generate.
@andriy-dmytruk can you figure out why the test
io.micronaut.openapi.generator.MicronautServerCodegenTest#testExtraAnnotations
is failing? Apparently an extra annotation declared in the spec isn't applied to a field. It may be related to renames I have made but I am not sure.