mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 03:47:05 +00:00
[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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user