Commit 685d9b9
authored
[Java][jersey3] Add error entity deserialization to ApiException (#23542)
* [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 errors1 parent 40f9887 commit 685d9b9
18 files changed
Lines changed: 686 additions & 57 deletions
File tree
- modules/openapi-generator/src
- main/resources/Java/libraries/jersey3
- test/java/org/openapitools/codegen/java/jersey3
- samples/client/petstore/java
- jersey3-oneOf/src/main/java/org/openapitools/client
- api
- jersey3/src
- main/java/org/openapitools/client
- api
- test/java/org/openapitools/client
Lines changed: 34 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
1196 | 1197 | | |
1197 | 1198 | | |
1198 | 1199 | | |
| 1200 | + | |
1199 | 1201 | | |
1200 | 1202 | | |
1201 | 1203 | | |
| |||
1212 | 1214 | | |
1213 | 1215 | | |
1214 | 1216 | | |
1215 | | - | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
1216 | 1220 | | |
1217 | 1221 | | |
1218 | 1222 | | |
| |||
1223 | 1227 | | |
1224 | 1228 | | |
1225 | 1229 | | |
1226 | | - | |
| 1230 | + | |
1227 | 1231 | | |
1228 | 1232 | | |
1229 | 1233 | | |
| |||
1333 | 1337 | | |
1334 | 1338 | | |
1335 | 1339 | | |
| 1340 | + | |
| 1341 | + | |
1336 | 1342 | | |
1337 | 1343 | | |
1338 | 1344 | | |
1339 | 1345 | | |
1340 | 1346 | | |
1341 | 1347 | | |
1342 | 1348 | | |
1343 | | - | |
| 1349 | + | |
1344 | 1350 | | |
1345 | 1351 | | |
1346 | 1352 | | |
| |||
1351 | 1357 | | |
1352 | 1358 | | |
1353 | 1359 | | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
1354 | 1384 | | |
1355 | 1385 | | |
1356 | 1386 | | |
| |||
1377 | 1407 | | |
1378 | 1408 | | |
1379 | 1409 | | |
1380 | | - | |
| 1410 | + | |
1381 | 1411 | | |
1382 | 1412 | | |
1383 | 1413 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
198 | 204 | | |
199 | 205 | | |
200 | 206 | | |
201 | 207 | | |
202 | 208 | | |
203 | | - | |
| 209 | + | |
204 | 210 | | |
205 | 211 | | |
206 | 212 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
| |||
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
102 | 117 | | |
Lines changed: 124 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
0 commit comments