@@ -108,9 +108,6 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
108
108
boolean typeCoercion = ctxt .isEnabled (MapperFeature .ALLOW_COERCION_OF_SCALARS );
109
109
int match = 0 ;
110
110
JsonToken token = tree .traverse (jp .getCodec ()).nextToken ();
111
- // Local Object Mapper that forces strict validation
112
- ObjectMapper localObjectMapper = JSON .getMapper ();
113
- localObjectMapper .configure (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES , true );
114
111
115
112
// deserialize AULocalAccountIdentification
116
113
try {
@@ -129,7 +126,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
129
126
boolean typeMatch = Arrays .stream (AULocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
130
127
if (attemptParsing || typeMatch ) {
131
128
// Strict deserialization for oneOf models
132
- deserialized = localObjectMapper .readValue (tree .toString (), AULocalAccountIdentification .class );
129
+ deserialized = JSON . getMapper () .readValue (tree .toString (), AULocalAccountIdentification .class );
133
130
// typeMatch should enforce proper deserialization
134
131
match ++;
135
132
log .log (Level .FINER , "Input data matches schema 'AULocalAccountIdentification'" );
@@ -157,7 +154,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
157
154
boolean typeMatch = Arrays .stream (BRLocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
158
155
if (attemptParsing || typeMatch ) {
159
156
// Strict deserialization for oneOf models
160
- deserialized = localObjectMapper .readValue (tree .toString (), BRLocalAccountIdentification .class );
157
+ deserialized = JSON . getMapper () .readValue (tree .toString (), BRLocalAccountIdentification .class );
161
158
// typeMatch should enforce proper deserialization
162
159
match ++;
163
160
log .log (Level .FINER , "Input data matches schema 'BRLocalAccountIdentification'" );
@@ -185,7 +182,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
185
182
boolean typeMatch = Arrays .stream (CALocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
186
183
if (attemptParsing || typeMatch ) {
187
184
// Strict deserialization for oneOf models
188
- deserialized = localObjectMapper .readValue (tree .toString (), CALocalAccountIdentification .class );
185
+ deserialized = JSON . getMapper () .readValue (tree .toString (), CALocalAccountIdentification .class );
189
186
// typeMatch should enforce proper deserialization
190
187
match ++;
191
188
log .log (Level .FINER , "Input data matches schema 'CALocalAccountIdentification'" );
@@ -213,7 +210,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
213
210
boolean typeMatch = Arrays .stream (CZLocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
214
211
if (attemptParsing || typeMatch ) {
215
212
// Strict deserialization for oneOf models
216
- deserialized = localObjectMapper .readValue (tree .toString (), CZLocalAccountIdentification .class );
213
+ deserialized = JSON . getMapper () .readValue (tree .toString (), CZLocalAccountIdentification .class );
217
214
// typeMatch should enforce proper deserialization
218
215
match ++;
219
216
log .log (Level .FINER , "Input data matches schema 'CZLocalAccountIdentification'" );
@@ -241,7 +238,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
241
238
boolean typeMatch = Arrays .stream (DKLocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
242
239
if (attemptParsing || typeMatch ) {
243
240
// Strict deserialization for oneOf models
244
- deserialized = localObjectMapper .readValue (tree .toString (), DKLocalAccountIdentification .class );
241
+ deserialized = JSON . getMapper () .readValue (tree .toString (), DKLocalAccountIdentification .class );
245
242
// typeMatch should enforce proper deserialization
246
243
match ++;
247
244
log .log (Level .FINER , "Input data matches schema 'DKLocalAccountIdentification'" );
@@ -269,7 +266,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
269
266
boolean typeMatch = Arrays .stream (HKLocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
270
267
if (attemptParsing || typeMatch ) {
271
268
// Strict deserialization for oneOf models
272
- deserialized = localObjectMapper .readValue (tree .toString (), HKLocalAccountIdentification .class );
269
+ deserialized = JSON . getMapper () .readValue (tree .toString (), HKLocalAccountIdentification .class );
273
270
// typeMatch should enforce proper deserialization
274
271
match ++;
275
272
log .log (Level .FINER , "Input data matches schema 'HKLocalAccountIdentification'" );
@@ -297,7 +294,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
297
294
boolean typeMatch = Arrays .stream (HULocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
298
295
if (attemptParsing || typeMatch ) {
299
296
// Strict deserialization for oneOf models
300
- deserialized = localObjectMapper .readValue (tree .toString (), HULocalAccountIdentification .class );
297
+ deserialized = JSON . getMapper () .readValue (tree .toString (), HULocalAccountIdentification .class );
301
298
// typeMatch should enforce proper deserialization
302
299
match ++;
303
300
log .log (Level .FINER , "Input data matches schema 'HULocalAccountIdentification'" );
@@ -325,7 +322,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
325
322
boolean typeMatch = Arrays .stream (IbanAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
326
323
if (attemptParsing || typeMatch ) {
327
324
// Strict deserialization for oneOf models
328
- deserialized = localObjectMapper .readValue (tree .toString (), IbanAccountIdentification .class );
325
+ deserialized = JSON . getMapper () .readValue (tree .toString (), IbanAccountIdentification .class );
329
326
// typeMatch should enforce proper deserialization
330
327
match ++;
331
328
log .log (Level .FINER , "Input data matches schema 'IbanAccountIdentification'" );
@@ -353,7 +350,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
353
350
boolean typeMatch = Arrays .stream (NOLocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
354
351
if (attemptParsing || typeMatch ) {
355
352
// Strict deserialization for oneOf models
356
- deserialized = localObjectMapper .readValue (tree .toString (), NOLocalAccountIdentification .class );
353
+ deserialized = JSON . getMapper () .readValue (tree .toString (), NOLocalAccountIdentification .class );
357
354
// typeMatch should enforce proper deserialization
358
355
match ++;
359
356
log .log (Level .FINER , "Input data matches schema 'NOLocalAccountIdentification'" );
@@ -381,7 +378,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
381
378
boolean typeMatch = Arrays .stream (NZLocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
382
379
if (attemptParsing || typeMatch ) {
383
380
// Strict deserialization for oneOf models
384
- deserialized = localObjectMapper .readValue (tree .toString (), NZLocalAccountIdentification .class );
381
+ deserialized = JSON . getMapper () .readValue (tree .toString (), NZLocalAccountIdentification .class );
385
382
// typeMatch should enforce proper deserialization
386
383
match ++;
387
384
log .log (Level .FINER , "Input data matches schema 'NZLocalAccountIdentification'" );
@@ -409,7 +406,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
409
406
boolean typeMatch = Arrays .stream (NumberAndBicAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
410
407
if (attemptParsing || typeMatch ) {
411
408
// Strict deserialization for oneOf models
412
- deserialized = localObjectMapper .readValue (tree .toString (), NumberAndBicAccountIdentification .class );
409
+ deserialized = JSON . getMapper () .readValue (tree .toString (), NumberAndBicAccountIdentification .class );
413
410
// typeMatch should enforce proper deserialization
414
411
match ++;
415
412
log .log (Level .FINER , "Input data matches schema 'NumberAndBicAccountIdentification'" );
@@ -437,7 +434,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
437
434
boolean typeMatch = Arrays .stream (PLLocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
438
435
if (attemptParsing || typeMatch ) {
439
436
// Strict deserialization for oneOf models
440
- deserialized = localObjectMapper .readValue (tree .toString (), PLLocalAccountIdentification .class );
437
+ deserialized = JSON . getMapper () .readValue (tree .toString (), PLLocalAccountIdentification .class );
441
438
// typeMatch should enforce proper deserialization
442
439
match ++;
443
440
log .log (Level .FINER , "Input data matches schema 'PLLocalAccountIdentification'" );
@@ -465,7 +462,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
465
462
boolean typeMatch = Arrays .stream (SELocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
466
463
if (attemptParsing || typeMatch ) {
467
464
// Strict deserialization for oneOf models
468
- deserialized = localObjectMapper .readValue (tree .toString (), SELocalAccountIdentification .class );
465
+ deserialized = JSON . getMapper () .readValue (tree .toString (), SELocalAccountIdentification .class );
469
466
// typeMatch should enforce proper deserialization
470
467
match ++;
471
468
log .log (Level .FINER , "Input data matches schema 'SELocalAccountIdentification'" );
@@ -493,7 +490,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
493
490
boolean typeMatch = Arrays .stream (SGLocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
494
491
if (attemptParsing || typeMatch ) {
495
492
// Strict deserialization for oneOf models
496
- deserialized = localObjectMapper .readValue (tree .toString (), SGLocalAccountIdentification .class );
493
+ deserialized = JSON . getMapper () .readValue (tree .toString (), SGLocalAccountIdentification .class );
497
494
// typeMatch should enforce proper deserialization
498
495
match ++;
499
496
log .log (Level .FINER , "Input data matches schema 'SGLocalAccountIdentification'" );
@@ -521,7 +518,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
521
518
boolean typeMatch = Arrays .stream (UKLocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
522
519
if (attemptParsing || typeMatch ) {
523
520
// Strict deserialization for oneOf models
524
- deserialized = localObjectMapper .readValue (tree .toString (), UKLocalAccountIdentification .class );
521
+ deserialized = JSON . getMapper () .readValue (tree .toString (), UKLocalAccountIdentification .class );
525
522
// typeMatch should enforce proper deserialization
526
523
match ++;
527
524
log .log (Level .FINER , "Input data matches schema 'UKLocalAccountIdentification'" );
@@ -549,7 +546,7 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
549
546
boolean typeMatch = Arrays .stream (USLocalAccountIdentification .TypeEnum .values ()).anyMatch ((t ) -> t .getValue ().contains (tree .findValue ("type" ).asText ()));
550
547
if (attemptParsing || typeMatch ) {
551
548
// Strict deserialization for oneOf models
552
- deserialized = localObjectMapper .readValue (tree .toString (), USLocalAccountIdentification .class );
549
+ deserialized = JSON . getMapper () .readValue (tree .toString (), USLocalAccountIdentification .class );
553
550
// typeMatch should enforce proper deserialization
554
551
match ++;
555
552
log .log (Level .FINER , "Input data matches schema 'USLocalAccountIdentification'" );
@@ -568,7 +565,6 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali
568
565
log .log (Level .WARNING , String .format ("Warning, indecisive deserialization for BankAccountIdentificationValidationRequestAccountIdentification: %d classes match result, expected 1" , match ));
569
566
}
570
567
571
- localObjectMapper .configure (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES , false );
572
568
BankAccountIdentificationValidationRequestAccountIdentification ret = new BankAccountIdentificationValidationRequestAccountIdentification ();
573
569
ret .setActualInstance (deserialized );
574
570
return ret ;
@@ -991,5 +987,24 @@ public USLocalAccountIdentification getUSLocalAccountIdentification() throws Cla
991
987
return (USLocalAccountIdentification )super .getActualInstance ();
992
988
}
993
989
990
+ /**
991
+ * Create an instance of BankAccountIdentificationValidationRequestAccountIdentification given an JSON string
992
+ *
993
+ * @param jsonString JSON string
994
+ * @return An instance of BankAccountIdentificationValidationRequestAccountIdentification
995
+ * @throws IOException if the JSON string is invalid with respect to BankAccountIdentificationValidationRequestAccountIdentification
996
+ */
997
+ public static BankAccountIdentificationValidationRequestAccountIdentification fromJson (String jsonString ) throws IOException {
998
+ return JSON .getMapper ().readValue (jsonString , BankAccountIdentificationValidationRequestAccountIdentification .class );
999
+ }
1000
+
1001
+ /**
1002
+ * Convert an instance of BankAccountIdentificationValidationRequestAccountIdentification to an JSON string
1003
+ *
1004
+ * @return JSON string
1005
+ */
1006
+ public String toJson () throws JsonProcessingException {
1007
+ return JSON .getMapper ().writeValueAsString (this );
1008
+ }
994
1009
}
995
1010
0 commit comments