[java] support required nullable properties on java okhttp-gson generator (#15462)

* Support required nullable properties on java okhttp-gson generator

* regen client after merge

* covering cases
* nullable - true ; required - true
* nullable - false ; required - true
* nullable - true ; required - false
* nullable - false ; required - false
This commit is contained in:
samypr100
2023-05-26 09:02:48 -04:00
committed by GitHub
parent b3b672fdfc
commit fe6e4e459f
84 changed files with 14818 additions and 9 deletions

View File

@@ -185,7 +185,7 @@ public class Animal {
case "Dog":
Dog.validateJsonObject(jsonObj);
break;
default:
default:
throw new IllegalArgumentException(String.format("The value of the `className` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue));
}
}

View File

@@ -156,7 +156,7 @@ public class Cat extends Animal {
case "BigCat":
BigCat.validateJsonObject(jsonObj);
break;
default:
default:
throw new IllegalArgumentException(String.format("The value of the `className` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue));
}
}