-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Ibaranga master #20129
Closed
Closed
Ibaranga master #20129
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
…mDoc.mustache` --- ### What - Introduce `springHttpClientAdapter` for `spring-http-interface` - This property is used for selecting HTTP client implementation in Spring HTTP interfaces, with separate templates for each client configuration - Added an `spring-http-interface`-specific **empty** `paramDoc.mustache` --- ### Why - Enable selecting different HTTP client implementations when generating Spring HTTP client interfaces - Provides additional flexibility for users who want to generate non-reactive Spring Boot applications. --- ### How - `springHttpClientAdapter`: Allows users to choose between different HTTP client implementations used in `HttpInterfacesAbstractConfigurator`: - `web-client` (set by default, to ensure **backward compatibility**) - `rest-client` - `rest-template` - Separate templates for each `HttpInterfacesAbstractConfigurator` implementation: - `httpInterfacesRestClientConfiguration.mustache` - `httpInterfacesRestTemplateConfiguration.mustache` - `httpInterfacesWebClientConfiguration.mustache` - Log warning for configuration mismatch - When `reactive: false` is used in combination with the reactive `web-client`, it warns users of potential configuration mismatches, and suggests switching to `rest-template` or `rest-client` for non-reactive configurations. - Remove unnecessary paramDoc - Added an `spring-http-interface`-specific **empty** `paramDoc.mustache` in `JavaSpring/libraries/spring-http-interface/paramDoc.mustache` - This prevents inheriting the `@Parameter` annotations from the default Spring template located at `JavaSpring/paramDoc.mustache`. - Otherwise, the generated code includes `@Parameter` annotations on request body parameters, which were causing compile errors due to missing imports --- ### Testing Done - **Manual testing**: Verified that the generated code uses `WebClient`, `RestTemplate`, or `RestClient` based on the value of the `springHttpClientAdapter` property. - **Tested different configurations**: - **`reactive: false` & `web-client`**: Logs a warning, suggesting the use of `rest-client` or `rest-template`. - **`springHttpClientAdapter: rest-template`**: Generates code with `RestTemplateAdapter` using the `httpInterfacesRestTemplateConfiguration.mustache`. - **`springHttpClientAdapter: web-client` (default)**: Generates code using `WebClientAdapter` from `httpInterfacesWebClientConfiguration.mustache` and ensures backward compatibility. - **Tested `paramDoc.mustache` change**: Verified that the empty `paramDoc.mustache` prevents the generation of `@Parameter` annotations on request body parameters and resolves the compile errors caused by missing imports. --- ### PR checklist - [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md). - [ ] 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](https://github.com/OpenAPITools/openapi-generator#14---build-projects) and update samples: ``` ./mvnw clean package ./bin/generate-samples.sh ./bin/configs/*.yaml ./bin/utils/export_docs_generators.sh ``` (For Windows users, please run the script in [Git BASH](https://gitforwindows.org/)) 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](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `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](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) members, so they are more likely to review the pull request.
…into ibaranga-master
5 tasks
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.
PR checklist
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.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)