Fixes fromProperty when property is required vs optional (#12858)

* Adds required boolean to fromProperty

* Adds required to other method signatures

* pythn-exp sample regenerated

* Samples regenerated

* Adds java test of fix
This commit is contained in:
Justin Black
2022-07-13 18:17:33 -07:00
committed by GitHub
parent 5aa0e0a456
commit c44fe8a04a
40 changed files with 224 additions and 155 deletions

View File

@@ -8,7 +8,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | | [optional] |
|**petType** | [**String**](#String) | | |
|**petType** | [**String**](#String) | | [optional] |

View File

@@ -105,10 +105,10 @@ public class ChildCat extends ParentPet {
* Get petType
* @return petType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_PET_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getPetType() {
return petType;
@@ -116,7 +116,7 @@ public class ChildCat extends ParentPet {
@JsonProperty(JSON_PROPERTY_PET_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setPetType(String petType) {
if (!PET_TYPE_VALUES.contains(petType)) {
throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES));