Skip to content
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

Fix java rest client ApiClient template to properly assign ObjectMapper #1

Conversation

CaptainAye
Copy link

Description:
The changes fix the ApiClient mustache template for java RestClient generator. Some of the constructors didn't properly pass the ObjectMapper parameter on, leading to creating default mapper even if the consumer passed custom instance.
Additionally, PR refactors the ApiClient constructors in order to move the creation logic to the one, most specific, constructor.

The pr fixes OpenAPITools#19667

Technical committee Java:
@martin-mfg, @lwlee2608, @Zomzog, @karismann, @jeff9finger, @cbornet, @lukoyanov, @jfiala, @sreeshas, @bbdouglas

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 
    ./bin/generate-samples.sh ./bin/configs/*.yaml
    ./bin/utils/export_docs_generators.sh
    
    (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.

NelsonVides and others added 30 commits October 1, 2024 14:51
* Add documentation to server and handlers

* Respond to at least one path-server

* Let url servers override base path

* Handle reading bigger bodies in cowboy

* Improve json error handling

* Regenerate erlang-server handlers

* Rework API module for performance and completion

* Regenerate erlang-server handlers
* feat: add token source support for rust async client

* chore: fix + regen samples

* chore: doc gen

* chore: missing generated sample files
* avoid npe when handling prefixItems in 3.1 spec

* update samples
* replace name by keyParamName in apiKey configuration

* update configuration generated in sample
* Add @deprecated tag for deprecated fields

* Add tests

* Generate samples from OpenAPI 3.0 file

* Revert to generate with previous OpenAPI 2.0 file

* Add new config 3.0 and generate samples

* Regenerate samples
* feat: add zapier response middleware

* chore: add samples
* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements

* [swift6] general improvements
* fix anyOf/oneOf normalization for 3.1 spec

* update samples
…ools#19750)

* Bugfix: exclusiveMinimum/Maximum must be booleans

* Add support for validating and decoding base64 byte strings

* Add support for validating RFC3339 datetime

* Simplify validate function for performance

* Regenerate erlang-server handlers
…olver causing IllegalAccessException for maps (OpenAPITools#19634)

* Update HandlebarsEngineAdapter.java

The old MY_FIELD_VALUE_RESOLVER.INSTANCE is equivalent to FieldValueResolver.INSTANCE, which is assigned `new FieldValueResolver();` so our custom class was never used.

* Add test verifying partial template works; Extract accessAwareFieldValueResolver; Add test verifying priority fo values extracted from object
* [swift6] remove unused lenientTypeCast option

* [swift6] remove unused lenientTypeCast option

* [swift5] remove unused lenientTypeCast option
…ITools#19479)

* Allow Content-Type merge-match+json for encoding

* Changes JSON recognition to more flexible regex

* Removes now useless JSON format list

* Removes empty spaces

* Adds explanatory PHPDoc comment

* Moves Json-detection to class HeaderSelector
4brunu and others added 18 commits October 3, 2024 14:06
…PITools#19765)

* [swift6] replace AnyCodable with JSONValue

* [swift6] create infrastructure folder

* [swift6] replace AnyCodable with JSONValue

* [swift6] create infrastructure folder

* [swift6] replace AnyCodable with JSONValue

* Try to fix CI
* [swift6] useSPMFileStructure by default

* [swift6] useSPMFileStructure by default

* [swift6] useSPMFileStructure by default
* Add @deprecated tag for deprecated operations

* Add test helper to verify a given line

* Add test to verify deprecated method

* Regenerate samples

* Delete tmp files after test

* Remove assertFileContains on specific line

* Update modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache

Co-authored-by: Joscha Feth <[email protected]>

* Correct indentation

* Regenerate samples

---------

Co-authored-by: Joscha Feth <[email protected]>
…rkflow (OpenAPITools#19773)

* Restore required python client dev dependency pytest-cov

* Harmonize python client workflow definitions

---------

Co-authored-by: Pascal Bachor <[email protected]>
…19776)

* [swift6] make async await the default response library

* [swift6] make async await the default response library

* [swift6] make async await the default response library
* [swift6] upload files as data

* [swift6] upload files as data

* [swift6] upload files as data

* [swift6] upload files as data

* [swift6] upload files as data

* [swift6] upload files as data
… with oneOf) (OpenAPITools#19781)

* better handling of primivitype type with oneOf

* fix null check, add tests

* add check for properties
…equest arguments (OpenAPITools#19654)

* ODM-11697: Adding null check in R-api

* bin/generate-samples.sh executed

---------

Co-authored-by: Kunitsyn Oleg <[email protected]>
* fix attemp

* use java.time.Instant

* fix client gen

* Tweeks

* header and form

* use scala 3 enum

* more tweeks

* add additional properties; add auth

* add form media type

* add modelsOnly

* add unit tests

* add petstore samples

* add doc

* add new samle to .github/workflows/samples-scala.yaml

* update build.sbt template

* simply the baseclient

* add None to optional field

* tweek auth model and format

---------

Co-authored-by: Jenny Leahy <[email protected]>
…reuse code (OpenAPITools#19761)

* feat(avro)/refactor: unify `*_POST_PROCESS_FILE` bahviour and code

* refactor: use existing function

* test: add simple test for post processor execution

* test: restrict concurrency to 1

* docs: add explanation to method
…n `3.1` specs (OpenAPITools#19696)

* fix(core): single value enums (`const`) are not generated correctly in `3.1` specs

* fix: const enums

* chore: update samples

* chore: update samples
@CaptainAye CaptainAye closed this Oct 6, 2024
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.

[BUG] [java][restclient] ObjectMapper passt to ApiClient is ignored