forked from loafle/openapi-generator-original
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:
@@ -8,7 +8,7 @@
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**name** | **String** | | [optional] |
|
||||
|**petType** | [**String**](#String) | | |
|
||||
|**petType** | [**String**](#String) | | [optional] |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user