[pull] master from OpenAPITools:master#571
Merged
Merged
Conversation
…ess (#23613) * [kotlin][jvm-spring-restclient] honour nullableReturnType in body access When `nullableReturnType=true` is set, the generated API function signature correctly returns a nullable type (e.g. `String?`), but the implementation force-unwraps the response body with `!!`. This throws a NullPointerException at runtime whenever the server returns an empty body, even though the signature promises that null is a valid return value. This change: * Drops the `!!` in `api.mustache` when `nullableReturnType` is enabled. * Propagates nullability into the generic type parameter of the `WithHttpInfo` variant for consistency. * Relaxes the type parameter in `ApiClient.kt.mustache` from `T: Any` to `T: Any?` so that `ResponseEntity<T?>` compiles. * Adds a new sample `kotlin-jvm-spring-3-restclient-nullable-return` that exercises `nullableReturnType=true`, including a regression test that reproduces the original NPE when the fix is reverted. * fix: add CI trigger path for new sample and align nullableReturnType in api_doc template - Add workflow trigger path for kotlin-jvm-spring-3-restclient-nullable-return sample so changes in that directory actually run CI. - Propagate nullableReturnType into the signature and return-type sections of api_doc.mustache (previously only the example code showed the '?'). - Regenerate DefaultApi.md for the new sample to reflect the fix. * chore: update samples
…#23574) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: brohacz <brohacz@users.noreply.github.com> Co-authored-by: KZwolski <KZwolski@users.noreply.github.com>
) * [Java][jersey3] Add error entity deserialization to ApiException - Add errorEntity field and getErrorEntity() method to ApiException - Add deserializeErrorEntity method to ApiClient - Pass errorTypes map from API methods to invokeAPI - Enables automatic deserialization of error response bodies - Fixes #4777 * Add unit tests for errorEntity deserialization feature - Add JavaJersey3ErrorEntityTest with 8 test cases - Tests verify template changes for errorEntity feature - 642 Java tests passed - no regressions - Fixes #4777 * Fix forbidden API check: specify UTF-8 charset The test was using String(byte[]) without specifying charset, which is flagged by forbiddenapis as using the default charset. * chore: regenerate Java jersey3 samples with errorEntity feature - Regenerate samples to verify templates work correctly - ApiException now contains errorEntity and getErrorEntity() - API methods include localVarErrorTypes for error deserialization - Fixes #4777 * fix: return null instead of error message on deserialization failure When deserializeErrorEntity fails, return null instead of a synthetic String message to maintain correct errorEntity semantics (null on failure). Fixes P2 issue from cubic-dev-ai review. * chore: regenerate jersey3-oneOf sample with errorEntity feature * test: add functional test for errorEntity deserialization - Add JavaJersey3ErrorEntityFunctionalTest - Verifies generated templates include errorEntity field and methods - Verifies deserializeErrorEntity returns null on failure (P2 fix) - Related to issue #4777 and PR #23542 * test: fix path issue in functional test - Correct the JERSEY3_TEMPLATE_DIR path - All 4 functional tests now pass * fix: address review comments from wing328 - Add docstring to deserializeErrorEntity method - Remove SmartBear Software copyright from test files * chore: regenerate jersey3 samples after adding docstring to deserializeErrorEntity * chore: regenerate samples without generation timestamp Regenerate jersey3 and jersey3-oneOf samples with hideGenerationTimestamp=true to fix P2 non-deterministic timestamp issues in @generated annotations. * fix: add missing dependencies for jersey3 samples Add jakarta.validation-api and commons-lang3 dependencies to fix compilation errors in Quadrilateral, SimpleQuadrilateral, and ComplexQuadrilateral models. * feat(jersey3): add error entity deserialization support - Add errorEntity field and getErrorEntity() method to ApiException - Add deserializeErrorEntity() method to ApiClient for error deserialization - Update API methods to pass errorTypes map for automatic error handling - Add unit tests for errorEntity feature - Regenerate jersey3 and jersey3-oneOf samples - Fix sample pom.xml to include required dependencies (validation, commons-lang3, http-signature) * feat(jersey3): add error entity deserialization support - Add errorEntity field and getErrorEntity() method to ApiException - Add deserializeErrorEntity() method to ApiClient for error deserialization - Update API methods to pass errorTypes map for automatic error handling - Add unit tests for errorEntity feature * feat(jersey3): add error entity deserialization support - Add errorEntity field and getErrorEntity() method to ApiException - Add deserializeErrorEntity() method to ApiClient for error deserialization - Update API methods to pass errorTypes map for automatic error handling - Add unit tests for errorEntity feature - Regenerate jersey3 and jersey3-oneOf samples - Fix sample pom.xml to include required dependencies (validation, commons-lang3, http-signature) * fix: address cubic-dev-ai review comments - Remove {{^-first}} to include ALL responses in errorType map (not just from 2nd response) - Add transient keyword to errorEntity field for serialization safety - Update test to expect transient keyword - Regenerate samples with fixes * fix: remove duplicate junit-version property from pom.xml Duplicate property removed to fix P2 issue from cubic-dev-ai review. * chore: regenerate jersey3 samples to fix compilation errors
Co-authored-by: William Cheng <wing328hk@gmail.com>
Swift6 generator ignores `nullable: true` on `additionalProperties` values, producing `[String: String]` instead of `[String: String?]`. This causes `DecodingError` at runtime when the JSON payload contains null values inside dictionaries. Mirrors the fix applied to the Kotlin generator in #23074.
* support null types * remove unnecessary code
* Remove barrel imports * add extensions where important * fix a few things * add file extension * fix model vs record imports * unify spaces between braces * remove extra line breaks between license and imports * add missing extension * regenerate sample files * remove extra whitespace * fix apis * fix imports for withoutRuntimeChecks * regen files * fix withoutRunTime checks again, accounting for type imports only * fix sagas * fix api entities generator * regen files? * regen files * regen samples after `mvn clean package` --------- Co-authored-by: Orrin Naylor <orrin.naylor@instacart.com>
…ient generator (fixes #22294) (#23446) * Add `useJackson3` support for apache-httpclient * Add support for OpenAPI Nullable for Jackson 3 * Add tests * Regenerate samples and docs * Fixes * Add apache-httpclient jackson3 sample * Add apache-httpclient-jackson3 to CI workflow * Regenerate samples * Fix workflow * Fix AI review comments * Regenerate files * Fix executable bit --------- Co-authored-by: William Cheng <wing328hk@gmail.com>
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )