mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 06:30:52 +00:00
support nullable check for OAS 3.1 (#15698)
This commit is contained in:
parent
d2446013d1
commit
bc7bdca87f
@ -669,7 +669,35 @@ public class OpenAPINormalizer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the schema is oneOf and the sub-schemas is null, set `nullable: true` instead.
|
* Check if the schema is of type 'null'
|
||||||
|
*
|
||||||
|
* Return true if the schema's type is 'null' or not specified
|
||||||
|
*
|
||||||
|
* @param schema Schema
|
||||||
|
*/
|
||||||
|
private boolean isNullTypeSchema(Schema schema) {
|
||||||
|
if (schema == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((schema.getType() == null || schema.getType().equals("null")) && schema.get$ref() == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert referenced enum of null only to `nullable:true`
|
||||||
|
Schema referencedSchema = ModelUtils.getReferencedSchema(openAPI, schema);
|
||||||
|
if (referencedSchema.getEnum() != null && referencedSchema.getEnum().size() == 1) {
|
||||||
|
if ("null".equals(String.valueOf(referencedSchema.getEnum().get(0)))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the schema is oneOf and the sub-schemas is null, set `nullable: true`
|
||||||
|
* instead.
|
||||||
* If there's only one sub-schema, simply return the sub-schema directly.
|
* If there's only one sub-schema, simply return the sub-schema directly.
|
||||||
*
|
*
|
||||||
* @param schema Schema
|
* @param schema Schema
|
||||||
@ -680,34 +708,18 @@ public class OpenAPINormalizer {
|
|||||||
return schema;
|
return schema;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (schema.getOneOf() != null && !schema.getOneOf().isEmpty()) {
|
List<Schema> oneOfSchemas = schema.getOneOf();
|
||||||
for (int i = 0; i < schema.getOneOf().size(); i++) {
|
if (oneOfSchemas != null) {
|
||||||
// convert null sub-schema to `nullable: true`
|
if (oneOfSchemas.removeIf(oneOf -> isNullTypeSchema(oneOf))) {
|
||||||
if (schema.getOneOf().get(i) == null ||
|
|
||||||
(((Schema) schema.getOneOf().get(i)).getType() == null &&
|
|
||||||
((Schema) schema.getOneOf().get(i)).get$ref() == null)) {
|
|
||||||
schema.getOneOf().remove(i);
|
|
||||||
schema.setNullable(true);
|
schema.setNullable(true);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// convert enum of null only to `nullable:true`
|
|
||||||
Schema oneOfElement = ModelUtils.getReferencedSchema(openAPI, (Schema) schema.getOneOf().get(i));
|
|
||||||
if (oneOfElement.getEnum() != null && oneOfElement.getEnum().size() == 1) {
|
|
||||||
if ("null".equals(String.valueOf(oneOfElement.getEnum().get(0)))) {
|
|
||||||
schema.setNullable(true);
|
|
||||||
schema.getOneOf().remove(i);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if only one element left, simplify to just the element (schema)
|
// if only one element left, simplify to just the element (schema)
|
||||||
if (schema.getOneOf().size() == 1) {
|
if (oneOfSchemas.size() == 1) {
|
||||||
if (Boolean.TRUE.equals(schema.getNullable())) { // retain nullable setting
|
if (Boolean.TRUE.equals(schema.getNullable())) { // retain nullable setting
|
||||||
((Schema) schema.getOneOf().get(0)).setNullable(true);
|
((Schema) oneOfSchemas.get(0)).setNullable(true);
|
||||||
|
}
|
||||||
|
return (Schema) oneOfSchemas.get(0);
|
||||||
}
|
}
|
||||||
return (Schema) schema.getOneOf().get(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -726,34 +738,18 @@ public class OpenAPINormalizer {
|
|||||||
return schema;
|
return schema;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (schema.getAnyOf() != null && !schema.getAnyOf().isEmpty()) {
|
List<Schema> anyOfSchemas = schema.getAnyOf();
|
||||||
for (int i = 0; i < schema.getAnyOf().size(); i++) {
|
if (anyOfSchemas != null) {
|
||||||
// convert null sub-schema to `nullable: true`
|
if (anyOfSchemas.removeIf(anyOf -> isNullTypeSchema(anyOf))) {
|
||||||
if (schema.getAnyOf().get(i) == null ||
|
|
||||||
(((Schema) schema.getAnyOf().get(i)).getType() == null &&
|
|
||||||
((Schema) schema.getAnyOf().get(i)).get$ref() == null)) {
|
|
||||||
schema.getAnyOf().remove(i);
|
|
||||||
schema.setNullable(true);
|
schema.setNullable(true);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// convert enum of null only to `nullable:true`
|
|
||||||
Schema anyOfElement = ModelUtils.getReferencedSchema(openAPI, (Schema) schema.getAnyOf().get(i));
|
|
||||||
if (anyOfElement.getEnum() != null && anyOfElement.getEnum().size() == 1) {
|
|
||||||
if ("null".equals(String.valueOf(anyOfElement.getEnum().get(0)))) {
|
|
||||||
schema.setNullable(true);
|
|
||||||
schema.getAnyOf().remove(i);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if only one element left, simplify to just the element (schema)
|
// if only one element left, simplify to just the element (schema)
|
||||||
if (schema.getAnyOf().size() == 1) {
|
if (anyOfSchemas.size() == 1) {
|
||||||
if (Boolean.TRUE.equals(schema.getNullable())) { // retain nullable setting
|
if (Boolean.TRUE.equals(schema.getNullable())) { // retain nullable setting
|
||||||
((Schema) schema.getAnyOf().get(0)).setNullable(true);
|
((Schema) anyOfSchemas.get(0)).setNullable(true);
|
||||||
}
|
}
|
||||||
return (Schema) schema.getAnyOf().get(0);
|
return (Schema) anyOfSchemas.get(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,11 +141,11 @@ public class OpenAPINormalizerTest {
|
|||||||
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/simplifyOneOfAnyOf_test.yaml");
|
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/simplifyOneOfAnyOf_test.yaml");
|
||||||
|
|
||||||
Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest");
|
Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest");
|
||||||
assertEquals(schema.getAnyOf().size(), 2);
|
assertEquals(schema.getAnyOf().size(), 4);
|
||||||
assertNull(schema.getNullable());
|
assertNull(schema.getNullable());
|
||||||
|
|
||||||
Schema schema2 = openAPI.getComponents().getSchemas().get("OneOfTest");
|
Schema schema2 = openAPI.getComponents().getSchemas().get("OneOfTest");
|
||||||
assertEquals(schema2.getOneOf().size(), 2);
|
assertEquals(schema2.getOneOf().size(), 4);
|
||||||
assertNull(schema2.getNullable());
|
assertNull(schema2.getNullable());
|
||||||
|
|
||||||
Schema schema5 = openAPI.getComponents().getSchemas().get("OneOfNullableTest");
|
Schema schema5 = openAPI.getComponents().getSchemas().get("OneOfNullableTest");
|
||||||
@ -168,6 +168,7 @@ public class OpenAPINormalizerTest {
|
|||||||
Schema schema4 = openAPI.getComponents().getSchemas().get("OneOfTest");
|
Schema schema4 = openAPI.getComponents().getSchemas().get("OneOfTest");
|
||||||
assertNull(schema4.getOneOf());
|
assertNull(schema4.getOneOf());
|
||||||
assertTrue(schema4 instanceof IntegerSchema);
|
assertTrue(schema4 instanceof IntegerSchema);
|
||||||
|
assertTrue(schema4.getNullable());
|
||||||
|
|
||||||
Schema schema6 = openAPI.getComponents().getSchemas().get("OneOfNullableTest");
|
Schema schema6 = openAPI.getComponents().getSchemas().get("OneOfNullableTest");
|
||||||
assertEquals(schema6.getOneOf().size(), 2);
|
assertEquals(schema6.getOneOf().size(), 2);
|
||||||
@ -273,7 +274,7 @@ public class OpenAPINormalizerTest {
|
|||||||
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/convertEnumNullToNullable_test.yaml");
|
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/convertEnumNullToNullable_test.yaml");
|
||||||
|
|
||||||
Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest");
|
Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest");
|
||||||
assertEquals(schema.getAnyOf().size(), 3);
|
assertEquals(schema.getAnyOf().size(), 4);
|
||||||
assertNull(schema.getNullable());
|
assertNull(schema.getNullable());
|
||||||
|
|
||||||
Map<String, String> options = new HashMap<>();
|
Map<String, String> options = new HashMap<>();
|
||||||
@ -292,7 +293,7 @@ public class OpenAPINormalizerTest {
|
|||||||
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/convertEnumNullToNullable_test.yaml");
|
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/convertEnumNullToNullable_test.yaml");
|
||||||
|
|
||||||
Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest");
|
Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest");
|
||||||
assertEquals(schema.getAnyOf().size(), 3);
|
assertEquals(schema.getAnyOf().size(), 4);
|
||||||
assertNull(schema.getNullable());
|
assertNull(schema.getNullable());
|
||||||
|
|
||||||
Map<String, String> options = new HashMap<>();
|
Map<String, String> options = new HashMap<>();
|
||||||
@ -313,7 +314,7 @@ public class OpenAPINormalizerTest {
|
|||||||
|
|
||||||
// before test
|
// before test
|
||||||
Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest");
|
Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest");
|
||||||
assertEquals(schema.getAnyOf().size(), 3);
|
assertEquals(schema.getAnyOf().size(), 4);
|
||||||
assertNull(schema.getNullable());
|
assertNull(schema.getNullable());
|
||||||
|
|
||||||
Map<String, String> options = new HashMap<>();
|
Map<String, String> options = new HashMap<>();
|
||||||
@ -323,7 +324,7 @@ public class OpenAPINormalizerTest {
|
|||||||
|
|
||||||
// checks should be the same after test
|
// checks should be the same after test
|
||||||
Schema schema3 = openAPI.getComponents().getSchemas().get("AnyOfTest");
|
Schema schema3 = openAPI.getComponents().getSchemas().get("AnyOfTest");
|
||||||
assertEquals(schema3.getAnyOf().size(), 3);
|
assertEquals(schema3.getAnyOf().size(), 4);
|
||||||
assertNull(schema3.getNullable());
|
assertNull(schema3.getNullable());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,12 +31,17 @@ components:
|
|||||||
anyOf:
|
anyOf:
|
||||||
- type: string
|
- type: string
|
||||||
- $ref: '#/components/schemas/EnumString'
|
- $ref: '#/components/schemas/EnumString'
|
||||||
|
- $ref: '#/components/schemas/EnumNullString'
|
||||||
- $ref: '#/components/schemas/EnumNull'
|
- $ref: '#/components/schemas/EnumNull'
|
||||||
EnumString:
|
EnumString:
|
||||||
type: string
|
type: string
|
||||||
enum:
|
enum:
|
||||||
- A
|
- A
|
||||||
- B
|
- B
|
||||||
|
EnumNullString:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- 'null'
|
||||||
EnumNull:
|
EnumNull:
|
||||||
type: string
|
type: string
|
||||||
enum:
|
enum:
|
||||||
|
@ -30,11 +30,15 @@ components:
|
|||||||
description: to test anyOf
|
description: to test anyOf
|
||||||
anyOf:
|
anyOf:
|
||||||
- type: string
|
- type: string
|
||||||
|
- type: 'null'
|
||||||
- type: null
|
- type: null
|
||||||
|
- $ref: null
|
||||||
OneOfTest:
|
OneOfTest:
|
||||||
description: to test oneOf
|
description: to test oneOf
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: integer
|
- type: integer
|
||||||
|
- type: 'null'
|
||||||
|
- type: null
|
||||||
- $ref: null
|
- $ref: null
|
||||||
OneOfNullableTest:
|
OneOfNullableTest:
|
||||||
description: to test oneOf nullable
|
description: to test oneOf nullable
|
||||||
|
@ -1971,8 +1971,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2021,8 +2021,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -90,7 +90,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets ShapeOrNull
|
/// Gets or Sets ShapeOrNull
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(Name = "shapeOrNull", EmitDefaultValue = false)]
|
[DataMember(Name = "shapeOrNull", EmitDefaultValue = true)]
|
||||||
public ShapeOrNull ShapeOrNull
|
public ShapeOrNull ShapeOrNull
|
||||||
{
|
{
|
||||||
get{ return _ShapeOrNull;}
|
get{ return _ShapeOrNull;}
|
||||||
|
@ -1971,8 +1971,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2021,8 +2021,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**MainShape** | [**Shape**](Shape.md) | | [optional]
|
**MainShape** | [**Shape**](Shape.md) | | [optional]
|
||||||
**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional]
|
|
||||||
**Shapes** | [**List<Shape>**](Shape.md) | | [optional]
|
**Shapes** | [**List<Shape>**](Shape.md) | | [optional]
|
||||||
**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional]
|
**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional]
|
||||||
|
**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional]
|
||||||
|
|
||||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||||
|
|
||||||
|
@ -34,16 +34,16 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// Initializes a new instance of the <see cref="Drawing" /> class.
|
/// Initializes a new instance of the <see cref="Drawing" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="mainShape">mainShape</param>
|
/// <param name="mainShape">mainShape</param>
|
||||||
/// <param name="shapeOrNull">shapeOrNull</param>
|
|
||||||
/// <param name="shapes">shapes</param>
|
/// <param name="shapes">shapes</param>
|
||||||
/// <param name="nullableShape">nullableShape</param>
|
/// <param name="nullableShape">nullableShape</param>
|
||||||
|
/// <param name="shapeOrNull">shapeOrNull</param>
|
||||||
[JsonConstructor]
|
[JsonConstructor]
|
||||||
public Drawing(Shape mainShape, ShapeOrNull shapeOrNull, List<Shape> shapes, NullableShape? nullableShape = default) : base()
|
public Drawing(Shape mainShape, List<Shape> shapes, NullableShape? nullableShape = default, ShapeOrNull? shapeOrNull = default) : base()
|
||||||
{
|
{
|
||||||
MainShape = mainShape;
|
MainShape = mainShape;
|
||||||
ShapeOrNull = shapeOrNull;
|
|
||||||
Shapes = shapes;
|
Shapes = shapes;
|
||||||
NullableShape = nullableShape;
|
NullableShape = nullableShape;
|
||||||
|
ShapeOrNull = shapeOrNull;
|
||||||
OnCreated();
|
OnCreated();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,12 +55,6 @@ namespace Org.OpenAPITools.Model
|
|||||||
[JsonPropertyName("mainShape")]
|
[JsonPropertyName("mainShape")]
|
||||||
public Shape MainShape { get; set; }
|
public Shape MainShape { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or Sets ShapeOrNull
|
|
||||||
/// </summary>
|
|
||||||
[JsonPropertyName("shapeOrNull")]
|
|
||||||
public ShapeOrNull ShapeOrNull { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets Shapes
|
/// Gets or Sets Shapes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -73,6 +67,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[JsonPropertyName("nullableShape")]
|
[JsonPropertyName("nullableShape")]
|
||||||
public NullableShape? NullableShape { get; set; }
|
public NullableShape? NullableShape { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ShapeOrNull
|
||||||
|
/// </summary>
|
||||||
|
[JsonPropertyName("shapeOrNull")]
|
||||||
|
public ShapeOrNull? ShapeOrNull { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -83,9 +83,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append("class Drawing {\n");
|
sb.Append("class Drawing {\n");
|
||||||
sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n");
|
sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n");
|
||||||
sb.Append(" MainShape: ").Append(MainShape).Append("\n");
|
sb.Append(" MainShape: ").Append(MainShape).Append("\n");
|
||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
|
||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -124,9 +124,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Shape? mainShape = default;
|
Shape? mainShape = default;
|
||||||
ShapeOrNull? shapeOrNull = default;
|
|
||||||
List<Shape>? shapes = default;
|
List<Shape>? shapes = default;
|
||||||
NullableShape? nullableShape = default;
|
NullableShape? nullableShape = default;
|
||||||
|
ShapeOrNull? shapeOrNull = default;
|
||||||
|
|
||||||
while (utf8JsonReader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
@ -147,10 +147,6 @@ namespace Org.OpenAPITools.Model
|
|||||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
|
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "shapeOrNull":
|
|
||||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
|
||||||
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
|
|
||||||
break;
|
|
||||||
case "shapes":
|
case "shapes":
|
||||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
|
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
@ -159,6 +155,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
|
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
|
case "shapeOrNull":
|
||||||
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
|
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -168,13 +168,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
if (mainShape == null)
|
if (mainShape == null)
|
||||||
throw new ArgumentNullException(nameof(mainShape), "Property is required for class Drawing.");
|
throw new ArgumentNullException(nameof(mainShape), "Property is required for class Drawing.");
|
||||||
|
|
||||||
if (shapeOrNull == null)
|
|
||||||
throw new ArgumentNullException(nameof(shapeOrNull), "Property is required for class Drawing.");
|
|
||||||
|
|
||||||
if (shapes == null)
|
if (shapes == null)
|
||||||
throw new ArgumentNullException(nameof(shapes), "Property is required for class Drawing.");
|
throw new ArgumentNullException(nameof(shapes), "Property is required for class Drawing.");
|
||||||
|
|
||||||
return new Drawing(mainShape, shapeOrNull, shapes, nullableShape);
|
return new Drawing(mainShape, shapes, nullableShape, shapeOrNull);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -190,12 +187,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
|
|
||||||
writer.WritePropertyName("mainShape");
|
writer.WritePropertyName("mainShape");
|
||||||
JsonSerializer.Serialize(writer, drawing.MainShape, jsonSerializerOptions);
|
JsonSerializer.Serialize(writer, drawing.MainShape, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("shapeOrNull");
|
|
||||||
JsonSerializer.Serialize(writer, drawing.ShapeOrNull, jsonSerializerOptions);
|
|
||||||
writer.WritePropertyName("shapes");
|
writer.WritePropertyName("shapes");
|
||||||
JsonSerializer.Serialize(writer, drawing.Shapes, jsonSerializerOptions);
|
JsonSerializer.Serialize(writer, drawing.Shapes, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("nullableShape");
|
writer.WritePropertyName("nullableShape");
|
||||||
JsonSerializer.Serialize(writer, drawing.NullableShape, jsonSerializerOptions);
|
JsonSerializer.Serialize(writer, drawing.NullableShape, jsonSerializerOptions);
|
||||||
|
writer.WritePropertyName("shapeOrNull");
|
||||||
|
JsonSerializer.Serialize(writer, drawing.ShapeOrNull, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -1971,8 +1971,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2021,8 +2021,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**MainShape** | [**Shape**](Shape.md) | | [optional]
|
**MainShape** | [**Shape**](Shape.md) | | [optional]
|
||||||
**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional]
|
|
||||||
**Shapes** | [**List<Shape>**](Shape.md) | | [optional]
|
**Shapes** | [**List<Shape>**](Shape.md) | | [optional]
|
||||||
**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional]
|
**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional]
|
||||||
|
**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional]
|
||||||
|
|
||||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||||
|
|
||||||
|
@ -32,16 +32,16 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// Initializes a new instance of the <see cref="Drawing" /> class.
|
/// Initializes a new instance of the <see cref="Drawing" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="mainShape">mainShape</param>
|
/// <param name="mainShape">mainShape</param>
|
||||||
/// <param name="shapeOrNull">shapeOrNull</param>
|
|
||||||
/// <param name="shapes">shapes</param>
|
/// <param name="shapes">shapes</param>
|
||||||
/// <param name="nullableShape">nullableShape</param>
|
/// <param name="nullableShape">nullableShape</param>
|
||||||
|
/// <param name="shapeOrNull">shapeOrNull</param>
|
||||||
[JsonConstructor]
|
[JsonConstructor]
|
||||||
public Drawing(Shape mainShape, ShapeOrNull shapeOrNull, List<Shape> shapes, NullableShape nullableShape = default) : base()
|
public Drawing(Shape mainShape, List<Shape> shapes, NullableShape nullableShape = default, ShapeOrNull shapeOrNull = default) : base()
|
||||||
{
|
{
|
||||||
MainShape = mainShape;
|
MainShape = mainShape;
|
||||||
ShapeOrNull = shapeOrNull;
|
|
||||||
Shapes = shapes;
|
Shapes = shapes;
|
||||||
NullableShape = nullableShape;
|
NullableShape = nullableShape;
|
||||||
|
ShapeOrNull = shapeOrNull;
|
||||||
OnCreated();
|
OnCreated();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,12 +53,6 @@ namespace Org.OpenAPITools.Model
|
|||||||
[JsonPropertyName("mainShape")]
|
[JsonPropertyName("mainShape")]
|
||||||
public Shape MainShape { get; set; }
|
public Shape MainShape { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or Sets ShapeOrNull
|
|
||||||
/// </summary>
|
|
||||||
[JsonPropertyName("shapeOrNull")]
|
|
||||||
public ShapeOrNull ShapeOrNull { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets Shapes
|
/// Gets or Sets Shapes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -71,6 +65,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[JsonPropertyName("nullableShape")]
|
[JsonPropertyName("nullableShape")]
|
||||||
public NullableShape NullableShape { get; set; }
|
public NullableShape NullableShape { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ShapeOrNull
|
||||||
|
/// </summary>
|
||||||
|
[JsonPropertyName("shapeOrNull")]
|
||||||
|
public ShapeOrNull ShapeOrNull { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -81,9 +81,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append("class Drawing {\n");
|
sb.Append("class Drawing {\n");
|
||||||
sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n");
|
sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n");
|
||||||
sb.Append(" MainShape: ").Append(MainShape).Append("\n");
|
sb.Append(" MainShape: ").Append(MainShape).Append("\n");
|
||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
|
||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -122,9 +122,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Shape mainShape = default;
|
Shape mainShape = default;
|
||||||
ShapeOrNull shapeOrNull = default;
|
|
||||||
List<Shape> shapes = default;
|
List<Shape> shapes = default;
|
||||||
NullableShape nullableShape = default;
|
NullableShape nullableShape = default;
|
||||||
|
ShapeOrNull shapeOrNull = default;
|
||||||
|
|
||||||
while (utf8JsonReader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
@ -145,10 +145,6 @@ namespace Org.OpenAPITools.Model
|
|||||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
|
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "shapeOrNull":
|
|
||||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
|
||||||
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
|
|
||||||
break;
|
|
||||||
case "shapes":
|
case "shapes":
|
||||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
|
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
@ -157,6 +153,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
|
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
|
case "shapeOrNull":
|
||||||
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
|
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -166,13 +166,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
if (mainShape == null)
|
if (mainShape == null)
|
||||||
throw new ArgumentNullException(nameof(mainShape), "Property is required for class Drawing.");
|
throw new ArgumentNullException(nameof(mainShape), "Property is required for class Drawing.");
|
||||||
|
|
||||||
if (shapeOrNull == null)
|
|
||||||
throw new ArgumentNullException(nameof(shapeOrNull), "Property is required for class Drawing.");
|
|
||||||
|
|
||||||
if (shapes == null)
|
if (shapes == null)
|
||||||
throw new ArgumentNullException(nameof(shapes), "Property is required for class Drawing.");
|
throw new ArgumentNullException(nameof(shapes), "Property is required for class Drawing.");
|
||||||
|
|
||||||
return new Drawing(mainShape, shapeOrNull, shapes, nullableShape);
|
return new Drawing(mainShape, shapes, nullableShape, shapeOrNull);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -188,12 +185,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
|
|
||||||
writer.WritePropertyName("mainShape");
|
writer.WritePropertyName("mainShape");
|
||||||
JsonSerializer.Serialize(writer, drawing.MainShape, jsonSerializerOptions);
|
JsonSerializer.Serialize(writer, drawing.MainShape, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("shapeOrNull");
|
|
||||||
JsonSerializer.Serialize(writer, drawing.ShapeOrNull, jsonSerializerOptions);
|
|
||||||
writer.WritePropertyName("shapes");
|
writer.WritePropertyName("shapes");
|
||||||
JsonSerializer.Serialize(writer, drawing.Shapes, jsonSerializerOptions);
|
JsonSerializer.Serialize(writer, drawing.Shapes, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("nullableShape");
|
writer.WritePropertyName("nullableShape");
|
||||||
JsonSerializer.Serialize(writer, drawing.NullableShape, jsonSerializerOptions);
|
JsonSerializer.Serialize(writer, drawing.NullableShape, jsonSerializerOptions);
|
||||||
|
writer.WritePropertyName("shapeOrNull");
|
||||||
|
JsonSerializer.Serialize(writer, drawing.ShapeOrNull, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -1971,8 +1971,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2021,8 +2021,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**MainShape** | [**Shape**](Shape.md) | | [optional]
|
**MainShape** | [**Shape**](Shape.md) | | [optional]
|
||||||
**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional]
|
|
||||||
**Shapes** | [**List<Shape>**](Shape.md) | | [optional]
|
**Shapes** | [**List<Shape>**](Shape.md) | | [optional]
|
||||||
**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional]
|
**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional]
|
||||||
|
**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional]
|
||||||
|
|
||||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||||
|
|
||||||
|
@ -32,16 +32,16 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// Initializes a new instance of the <see cref="Drawing" /> class.
|
/// Initializes a new instance of the <see cref="Drawing" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="mainShape">mainShape</param>
|
/// <param name="mainShape">mainShape</param>
|
||||||
/// <param name="shapeOrNull">shapeOrNull</param>
|
|
||||||
/// <param name="shapes">shapes</param>
|
/// <param name="shapes">shapes</param>
|
||||||
/// <param name="nullableShape">nullableShape</param>
|
/// <param name="nullableShape">nullableShape</param>
|
||||||
|
/// <param name="shapeOrNull">shapeOrNull</param>
|
||||||
[JsonConstructor]
|
[JsonConstructor]
|
||||||
public Drawing(Shape mainShape, ShapeOrNull shapeOrNull, List<Shape> shapes, NullableShape nullableShape = default) : base()
|
public Drawing(Shape mainShape, List<Shape> shapes, NullableShape nullableShape = default, ShapeOrNull shapeOrNull = default) : base()
|
||||||
{
|
{
|
||||||
MainShape = mainShape;
|
MainShape = mainShape;
|
||||||
ShapeOrNull = shapeOrNull;
|
|
||||||
Shapes = shapes;
|
Shapes = shapes;
|
||||||
NullableShape = nullableShape;
|
NullableShape = nullableShape;
|
||||||
|
ShapeOrNull = shapeOrNull;
|
||||||
OnCreated();
|
OnCreated();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,12 +53,6 @@ namespace Org.OpenAPITools.Model
|
|||||||
[JsonPropertyName("mainShape")]
|
[JsonPropertyName("mainShape")]
|
||||||
public Shape MainShape { get; set; }
|
public Shape MainShape { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or Sets ShapeOrNull
|
|
||||||
/// </summary>
|
|
||||||
[JsonPropertyName("shapeOrNull")]
|
|
||||||
public ShapeOrNull ShapeOrNull { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets Shapes
|
/// Gets or Sets Shapes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -71,6 +65,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[JsonPropertyName("nullableShape")]
|
[JsonPropertyName("nullableShape")]
|
||||||
public NullableShape NullableShape { get; set; }
|
public NullableShape NullableShape { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ShapeOrNull
|
||||||
|
/// </summary>
|
||||||
|
[JsonPropertyName("shapeOrNull")]
|
||||||
|
public ShapeOrNull ShapeOrNull { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -81,9 +81,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append("class Drawing {\n");
|
sb.Append("class Drawing {\n");
|
||||||
sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n");
|
sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n");
|
||||||
sb.Append(" MainShape: ").Append(MainShape).Append("\n");
|
sb.Append(" MainShape: ").Append(MainShape).Append("\n");
|
||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
|
||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -122,9 +122,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Shape mainShape = default;
|
Shape mainShape = default;
|
||||||
ShapeOrNull shapeOrNull = default;
|
|
||||||
List<Shape> shapes = default;
|
List<Shape> shapes = default;
|
||||||
NullableShape nullableShape = default;
|
NullableShape nullableShape = default;
|
||||||
|
ShapeOrNull shapeOrNull = default;
|
||||||
|
|
||||||
while (utf8JsonReader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
@ -145,10 +145,6 @@ namespace Org.OpenAPITools.Model
|
|||||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
|
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "shapeOrNull":
|
|
||||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
|
||||||
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
|
|
||||||
break;
|
|
||||||
case "shapes":
|
case "shapes":
|
||||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
|
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
@ -157,6 +153,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
|
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
|
case "shapeOrNull":
|
||||||
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
|
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -166,13 +166,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
if (mainShape == null)
|
if (mainShape == null)
|
||||||
throw new ArgumentNullException(nameof(mainShape), "Property is required for class Drawing.");
|
throw new ArgumentNullException(nameof(mainShape), "Property is required for class Drawing.");
|
||||||
|
|
||||||
if (shapeOrNull == null)
|
|
||||||
throw new ArgumentNullException(nameof(shapeOrNull), "Property is required for class Drawing.");
|
|
||||||
|
|
||||||
if (shapes == null)
|
if (shapes == null)
|
||||||
throw new ArgumentNullException(nameof(shapes), "Property is required for class Drawing.");
|
throw new ArgumentNullException(nameof(shapes), "Property is required for class Drawing.");
|
||||||
|
|
||||||
return new Drawing(mainShape, shapeOrNull, shapes, nullableShape);
|
return new Drawing(mainShape, shapes, nullableShape, shapeOrNull);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -188,12 +185,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
|
|
||||||
writer.WritePropertyName("mainShape");
|
writer.WritePropertyName("mainShape");
|
||||||
JsonSerializer.Serialize(writer, drawing.MainShape, jsonSerializerOptions);
|
JsonSerializer.Serialize(writer, drawing.MainShape, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("shapeOrNull");
|
|
||||||
JsonSerializer.Serialize(writer, drawing.ShapeOrNull, jsonSerializerOptions);
|
|
||||||
writer.WritePropertyName("shapes");
|
writer.WritePropertyName("shapes");
|
||||||
JsonSerializer.Serialize(writer, drawing.Shapes, jsonSerializerOptions);
|
JsonSerializer.Serialize(writer, drawing.Shapes, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("nullableShape");
|
writer.WritePropertyName("nullableShape");
|
||||||
JsonSerializer.Serialize(writer, drawing.NullableShape, jsonSerializerOptions);
|
JsonSerializer.Serialize(writer, drawing.NullableShape, jsonSerializerOptions);
|
||||||
|
writer.WritePropertyName("shapeOrNull");
|
||||||
|
JsonSerializer.Serialize(writer, drawing.ShapeOrNull, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -1971,8 +1971,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2021,8 +2021,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -57,7 +57,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets ShapeOrNull
|
/// Gets or Sets ShapeOrNull
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(Name = "shapeOrNull", EmitDefaultValue = false)]
|
[DataMember(Name = "shapeOrNull", EmitDefaultValue = true)]
|
||||||
public ShapeOrNull ShapeOrNull { get; set; }
|
public ShapeOrNull ShapeOrNull { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1971,8 +1971,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2021,8 +2021,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -56,7 +56,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets ShapeOrNull
|
/// Gets or Sets ShapeOrNull
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(Name = "shapeOrNull", EmitDefaultValue = false)]
|
[DataMember(Name = "shapeOrNull", EmitDefaultValue = true)]
|
||||||
public ShapeOrNull ShapeOrNull { get; set; }
|
public ShapeOrNull ShapeOrNull { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1971,8 +1971,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2021,8 +2021,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -56,7 +56,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets ShapeOrNull
|
/// Gets or Sets ShapeOrNull
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(Name = "shapeOrNull", EmitDefaultValue = false)]
|
[DataMember(Name = "shapeOrNull", EmitDefaultValue = true)]
|
||||||
public ShapeOrNull ShapeOrNull { get; set; }
|
public ShapeOrNull ShapeOrNull { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1971,8 +1971,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2021,8 +2021,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -56,7 +56,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets ShapeOrNull
|
/// Gets or Sets ShapeOrNull
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(Name = "shapeOrNull", EmitDefaultValue = false)]
|
[DataMember(Name = "shapeOrNull", EmitDefaultValue = true)]
|
||||||
public ShapeOrNull ShapeOrNull { get; set; }
|
public ShapeOrNull ShapeOrNull { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1971,8 +1971,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2021,8 +2021,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -54,7 +54,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets ShapeOrNull
|
/// Gets or Sets ShapeOrNull
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(Name = "shapeOrNull", EmitDefaultValue = false)]
|
[DataMember(Name = "shapeOrNull", EmitDefaultValue = true)]
|
||||||
public ShapeOrNull ShapeOrNull { get; set; }
|
public ShapeOrNull ShapeOrNull { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1971,8 +1971,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2021,8 +2021,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -56,7 +56,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets ShapeOrNull
|
/// Gets or Sets ShapeOrNull
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(Name = "shapeOrNull", EmitDefaultValue = false)]
|
[DataMember(Name = "shapeOrNull", EmitDefaultValue = true)]
|
||||||
public ShapeOrNull ShapeOrNull { get; set; }
|
public ShapeOrNull ShapeOrNull { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1971,8 +1971,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2021,8 +2021,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -56,7 +56,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets ShapeOrNull
|
/// Gets or Sets ShapeOrNull
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(Name = "shapeOrNull", EmitDefaultValue = false)]
|
[DataMember(Name = "shapeOrNull", EmitDefaultValue = true)]
|
||||||
public ShapeOrNull ShapeOrNull { get; set; }
|
public ShapeOrNull ShapeOrNull { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1973,8 +1973,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2023,8 +2023,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -55,7 +55,7 @@ public class Drawing {
|
|||||||
private Shape mainShape;
|
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;
|
private JsonNullable<ShapeOrNull> shapeOrNull = JsonNullable.<ShapeOrNull>undefined();
|
||||||
|
|
||||||
public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape";
|
public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape";
|
||||||
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>undefined();
|
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>undefined();
|
||||||
@ -92,7 +92,7 @@ public class Drawing {
|
|||||||
|
|
||||||
|
|
||||||
public Drawing shapeOrNull(ShapeOrNull shapeOrNull) {
|
public Drawing shapeOrNull(ShapeOrNull shapeOrNull) {
|
||||||
this.shapeOrNull = shapeOrNull;
|
this.shapeOrNull = JsonNullable.<ShapeOrNull>of(shapeOrNull);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,20 +101,28 @@ public class Drawing {
|
|||||||
* @return shapeOrNull
|
* @return shapeOrNull
|
||||||
**/
|
**/
|
||||||
@jakarta.annotation.Nullable
|
@jakarta.annotation.Nullable
|
||||||
|
@JsonIgnore
|
||||||
|
|
||||||
|
public ShapeOrNull getShapeOrNull() {
|
||||||
|
return shapeOrNull.orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
@JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL)
|
@JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL)
|
||||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||||
|
|
||||||
public ShapeOrNull getShapeOrNull() {
|
public JsonNullable<ShapeOrNull> getShapeOrNull_JsonNullable() {
|
||||||
return shapeOrNull;
|
return shapeOrNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL)
|
@JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL)
|
||||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
public void setShapeOrNull_JsonNullable(JsonNullable<ShapeOrNull> shapeOrNull) {
|
||||||
public void setShapeOrNull(ShapeOrNull shapeOrNull) {
|
|
||||||
this.shapeOrNull = shapeOrNull;
|
this.shapeOrNull = shapeOrNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setShapeOrNull(ShapeOrNull shapeOrNull) {
|
||||||
|
this.shapeOrNull = JsonNullable.<ShapeOrNull>of(shapeOrNull);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Drawing nullableShape(NullableShape nullableShape) {
|
public Drawing nullableShape(NullableShape nullableShape) {
|
||||||
this.nullableShape = JsonNullable.<NullableShape>of(nullableShape);
|
this.nullableShape = JsonNullable.<NullableShape>of(nullableShape);
|
||||||
@ -232,7 +240,7 @@ public class Drawing {
|
|||||||
}
|
}
|
||||||
Drawing drawing = (Drawing) o;
|
Drawing drawing = (Drawing) o;
|
||||||
return Objects.equals(this.mainShape, drawing.mainShape) &&
|
return Objects.equals(this.mainShape, drawing.mainShape) &&
|
||||||
Objects.equals(this.shapeOrNull, drawing.shapeOrNull) &&
|
equalsNullable(this.shapeOrNull, drawing.shapeOrNull) &&
|
||||||
equalsNullable(this.nullableShape, drawing.nullableShape) &&
|
equalsNullable(this.nullableShape, drawing.nullableShape) &&
|
||||||
Objects.equals(this.shapes, drawing.shapes)&&
|
Objects.equals(this.shapes, drawing.shapes)&&
|
||||||
Objects.equals(this.additionalProperties, drawing.additionalProperties);
|
Objects.equals(this.additionalProperties, drawing.additionalProperties);
|
||||||
@ -244,7 +252,7 @@ public class Drawing {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(mainShape, shapeOrNull, hashCodeNullable(nullableShape), shapes, additionalProperties);
|
return Objects.hash(mainShape, hashCodeNullable(shapeOrNull), hashCodeNullable(nullableShape), shapes, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <T> int hashCodeNullable(JsonNullable<T> a) {
|
private static <T> int hashCodeNullable(JsonNullable<T> a) {
|
||||||
|
@ -1973,8 +1973,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2023,8 +2023,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -512,7 +512,7 @@ export interface Drawing {
|
|||||||
* @type {ShapeOrNull}
|
* @type {ShapeOrNull}
|
||||||
* @memberof Drawing
|
* @memberof Drawing
|
||||||
*/
|
*/
|
||||||
'shapeOrNull'?: ShapeOrNull;
|
'shapeOrNull'?: ShapeOrNull | null;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {NullableShape}
|
* @type {NullableShape}
|
||||||
@ -846,7 +846,7 @@ export type Fruit = Apple | Banana;
|
|||||||
* @type FruitReq
|
* @type FruitReq
|
||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export type FruitReq = AppleReq | BananaReq | Null;
|
export type FruitReq = AppleReq | BananaReq;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -1520,7 +1520,7 @@ export interface ShapeInterface {
|
|||||||
* The value may be a shape or the \'null\' value. This is introduced in OAS schema >= 3.1.
|
* The value may be a shape or the \'null\' value. This is introduced in OAS schema >= 3.1.
|
||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export type ShapeOrNull = Null | Quadrilateral | Triangle;
|
export type ShapeOrNull = Quadrilateral | Triangle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -1973,8 +1973,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
fruitReq:
|
fruitReq:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/appleReq'
|
- $ref: '#/components/schemas/appleReq'
|
||||||
- $ref: '#/components/schemas/bananaReq'
|
- $ref: '#/components/schemas/bananaReq'
|
||||||
appleReq:
|
appleReq:
|
||||||
@ -2023,8 +2023,8 @@ components:
|
|||||||
in OAS schema >= 3.1.
|
in OAS schema >= 3.1.
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: shapeType
|
propertyName: shapeType
|
||||||
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: "null"
|
|
||||||
- $ref: '#/components/schemas/Triangle'
|
- $ref: '#/components/schemas/Triangle'
|
||||||
- $ref: '#/components/schemas/Quadrilateral'
|
- $ref: '#/components/schemas/Quadrilateral'
|
||||||
NullableShape:
|
NullableShape:
|
||||||
|
@ -55,7 +55,7 @@ public class Drawing {
|
|||||||
private Shape mainShape;
|
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;
|
private JsonNullable<ShapeOrNull> shapeOrNull = JsonNullable.<ShapeOrNull>undefined();
|
||||||
|
|
||||||
public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape";
|
public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape";
|
||||||
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>undefined();
|
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>undefined();
|
||||||
@ -92,7 +92,7 @@ public class Drawing {
|
|||||||
|
|
||||||
|
|
||||||
public Drawing shapeOrNull(ShapeOrNull shapeOrNull) {
|
public Drawing shapeOrNull(ShapeOrNull shapeOrNull) {
|
||||||
this.shapeOrNull = shapeOrNull;
|
this.shapeOrNull = JsonNullable.<ShapeOrNull>of(shapeOrNull);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,20 +101,28 @@ public class Drawing {
|
|||||||
* @return shapeOrNull
|
* @return shapeOrNull
|
||||||
**/
|
**/
|
||||||
@javax.annotation.Nullable
|
@javax.annotation.Nullable
|
||||||
|
@JsonIgnore
|
||||||
|
|
||||||
|
public ShapeOrNull getShapeOrNull() {
|
||||||
|
return shapeOrNull.orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
@JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL)
|
@JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL)
|
||||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||||
|
|
||||||
public ShapeOrNull getShapeOrNull() {
|
public JsonNullable<ShapeOrNull> getShapeOrNull_JsonNullable() {
|
||||||
return shapeOrNull;
|
return shapeOrNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL)
|
@JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL)
|
||||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
public void setShapeOrNull_JsonNullable(JsonNullable<ShapeOrNull> shapeOrNull) {
|
||||||
public void setShapeOrNull(ShapeOrNull shapeOrNull) {
|
|
||||||
this.shapeOrNull = shapeOrNull;
|
this.shapeOrNull = shapeOrNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setShapeOrNull(ShapeOrNull shapeOrNull) {
|
||||||
|
this.shapeOrNull = JsonNullable.<ShapeOrNull>of(shapeOrNull);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Drawing nullableShape(NullableShape nullableShape) {
|
public Drawing nullableShape(NullableShape nullableShape) {
|
||||||
this.nullableShape = JsonNullable.<NullableShape>of(nullableShape);
|
this.nullableShape = JsonNullable.<NullableShape>of(nullableShape);
|
||||||
@ -232,7 +240,7 @@ public class Drawing {
|
|||||||
}
|
}
|
||||||
Drawing drawing = (Drawing) o;
|
Drawing drawing = (Drawing) o;
|
||||||
return Objects.equals(this.mainShape, drawing.mainShape) &&
|
return Objects.equals(this.mainShape, drawing.mainShape) &&
|
||||||
Objects.equals(this.shapeOrNull, drawing.shapeOrNull) &&
|
equalsNullable(this.shapeOrNull, drawing.shapeOrNull) &&
|
||||||
equalsNullable(this.nullableShape, drawing.nullableShape) &&
|
equalsNullable(this.nullableShape, drawing.nullableShape) &&
|
||||||
Objects.equals(this.shapes, drawing.shapes)&&
|
Objects.equals(this.shapes, drawing.shapes)&&
|
||||||
Objects.equals(this.additionalProperties, drawing.additionalProperties);
|
Objects.equals(this.additionalProperties, drawing.additionalProperties);
|
||||||
@ -244,7 +252,7 @@ public class Drawing {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(mainShape, shapeOrNull, hashCodeNullable(nullableShape), shapes, additionalProperties);
|
return Objects.hash(mainShape, hashCodeNullable(shapeOrNull), hashCodeNullable(nullableShape), shapes, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <T> int hashCodeNullable(JsonNullable<T> a) {
|
private static <T> int hashCodeNullable(JsonNullable<T> a) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user