forked from loafle/openapi-generator-original
Fix default value generation for composed schemas in AbstractJavaCodegen (#8918)
This commit is contained in:
parent
0f981fffc3
commit
03be3c612d
@ -941,6 +941,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
return super.toDefaultValue(schema);
|
return super.toDefaultValue(schema);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
} else if (ModelUtils.isComposedSchema(schema)) {
|
||||||
|
if (schema.getDefault() != null) {
|
||||||
|
return super.toDefaultValue(schema);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.toDefaultValue(schema);
|
return super.toDefaultValue(schema);
|
||||||
|
@ -53,13 +53,13 @@ import org.openapitools.client.JSON;
|
|||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||||
public class Drawing {
|
public class Drawing {
|
||||||
public static final String JSON_PROPERTY_MAIN_SHAPE = "mainShape";
|
public static final String JSON_PROPERTY_MAIN_SHAPE = "mainShape";
|
||||||
private Shape mainShape = null;
|
private Shape mainShape;
|
||||||
|
|
||||||
public static final String JSON_PROPERTY_SHAPE_OR_NULL = "shapeOrNull";
|
public static final String JSON_PROPERTY_SHAPE_OR_NULL = "shapeOrNull";
|
||||||
private ShapeOrNull shapeOrNull = null;
|
private ShapeOrNull shapeOrNull;
|
||||||
|
|
||||||
public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape";
|
public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape";
|
||||||
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>of(null);
|
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>undefined();
|
||||||
|
|
||||||
public static final String JSON_PROPERTY_SHAPES = "shapes";
|
public static final String JSON_PROPERTY_SHAPES = "shapes";
|
||||||
private List<Shape> shapes = null;
|
private List<Shape> shapes = null;
|
||||||
|
@ -54,13 +54,13 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
|||||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||||
public class Drawing extends HashMap<String, Fruit> {
|
public class Drawing extends HashMap<String, Fruit> {
|
||||||
public static final String JSON_PROPERTY_MAIN_SHAPE = "mainShape";
|
public static final String JSON_PROPERTY_MAIN_SHAPE = "mainShape";
|
||||||
private Shape mainShape = null;
|
private Shape mainShape;
|
||||||
|
|
||||||
public static final String JSON_PROPERTY_SHAPE_OR_NULL = "shapeOrNull";
|
public static final String JSON_PROPERTY_SHAPE_OR_NULL = "shapeOrNull";
|
||||||
private ShapeOrNull shapeOrNull = null;
|
private ShapeOrNull shapeOrNull;
|
||||||
|
|
||||||
public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape";
|
public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape";
|
||||||
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>of(null);
|
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>undefined();
|
||||||
|
|
||||||
public static final String JSON_PROPERTY_SHAPES = "shapes";
|
public static final String JSON_PROPERTY_SHAPES = "shapes";
|
||||||
private List<Shape> shapes = null;
|
private List<Shape> shapes = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user