Skip to content

Commit eebc7d4

Browse files
committed
review feedback from generator PR
1 parent 452bd2c commit eebc7d4

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv4.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
581581
"Expected the field `ipVersion` to be a primitive type in the JSON string but got `%s`",
582582
jsonObj.get("ipVersion").toString()));
583583
}
584+
// OVERRIDE: this if block fixes oneOf issues
585+
if (!"ipv4".equals(jsonObj.get("ipVersion").getAsString())) {
586+
throw new IllegalArgumentException(
587+
String.format(
588+
java.util.Locale.ROOT,
589+
"Expectd the field `ipVersion` to have value `ipv4` but got `%s`",
590+
jsonObj.get("ipVersion")));
591+
}
584592
// validate the required field `ipVersion`
585593
IpVersionEnum.validateJsonElement(jsonObj.get("ipVersion"));
586594
// ensure the optional json data is an array if present

‎services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopBlackhole.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
245245
"Expected the field `type` to be a primitive type in the JSON string but got `%s`",
246246
jsonObj.get("type").toString()));
247247
}
248+
// OVERRIDE: this if block fixes oneOf issues
249+
if (!"blackhole".equals(jsonObj.get("type").getAsString())) {
250+
throw new IllegalArgumentException(
251+
String.format(
252+
java.util.Locale.ROOT,
253+
"Expectd the field `type` to have value `blackhole` but got `%s`",
254+
jsonObj.get("type")));
255+
}
248256
// validate the required field `type`
249257
TypeEnum.validateJsonElement(jsonObj.get("type"));
250258
}

0 commit comments

Comments
 (0)