forked from loafle/openapi-generator-original
Compare commits
1 Commits
master
...
devhl-labs
Author | SHA1 | Date | |
---|---|---|---|
|
564a527f0d |
@ -6,34 +6,34 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override {{classname}} Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override {{classname}} Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
{{#composedSchemas.anyOf}}
|
{{#composedSchemas.anyOf}}
|
||||||
Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = reader;
|
Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = utf8JsonReader;
|
||||||
bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, options, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}});
|
bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, jsonSerializerOptions, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}});
|
||||||
|
|
||||||
{{/composedSchemas.anyOf}}
|
{{/composedSchemas.anyOf}}
|
||||||
{{#composedSchemas.oneOf}}
|
{{#composedSchemas.oneOf}}
|
||||||
Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = reader;
|
Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = utf8JsonReader;
|
||||||
bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, options, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}});
|
bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, jsonSerializerOptions, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}});
|
||||||
|
|
||||||
{{/composedSchemas.oneOf}}
|
{{/composedSchemas.oneOf}}
|
||||||
{{#composedSchemas.allOf}}
|
{{#composedSchemas.allOf}}
|
||||||
{{^isInherited}}
|
{{^isInherited}}
|
||||||
Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = reader;
|
Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = utf8JsonReader;
|
||||||
bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref reader, options, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}});
|
bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref utf8JsonReader, jsonSerializerOptions, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}});
|
||||||
|
|
||||||
{{/isInherited}}
|
{{/isInherited}}
|
||||||
{{/composedSchemas.allOf}}
|
{{/composedSchemas.allOf}}
|
||||||
@ -41,18 +41,18 @@
|
|||||||
{{#isInnerEnum}}{{^isMap}}{{classname}}.{{/isMap}}{{/isInnerEnum}}{{{datatypeWithEnum}}}{{#isEnum}}{{#isNullable}}?{{/isNullable}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = default;
|
{{#isInnerEnum}}{{^isMap}}{{classname}}.{{/isMap}}{{/isInnerEnum}}{{{datatypeWithEnum}}}{{#isEnum}}{{#isNullable}}?{{/isNullable}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = default;
|
||||||
{{/allVars}}
|
{{/allVars}}
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string{{nrt?}} propertyName = reader.GetString();
|
string{{nrt?}} propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -62,38 +62,38 @@
|
|||||||
{{^isMap}}
|
{{^isMap}}
|
||||||
{{^isEnum}}
|
{{^isEnum}}
|
||||||
{{^isUuid}}
|
{{^isUuid}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetString();
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetString();
|
||||||
{{/isUuid}}
|
{{/isUuid}}
|
||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
{{/isMap}}
|
{{/isMap}}
|
||||||
{{/isString}}
|
{{/isString}}
|
||||||
{{#isBoolean}}
|
{{#isBoolean}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetBoolean();
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetBoolean();
|
||||||
{{/isBoolean}}
|
{{/isBoolean}}
|
||||||
{{#isNumeric}}
|
{{#isNumeric}}
|
||||||
{{^isEnum}}
|
{{^isEnum}}
|
||||||
{{#isDouble}}
|
{{#isDouble}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetDouble();
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetDouble();
|
||||||
{{/isDouble}}
|
{{/isDouble}}
|
||||||
{{#isDecimal}}
|
{{#isDecimal}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetDecimal();
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetDecimal();
|
||||||
{{/isDecimal}}
|
{{/isDecimal}}
|
||||||
{{#isFloat}}
|
{{#isFloat}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = (float)reader.GetDouble();
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = (float)utf8JsonReader.GetDouble();
|
||||||
{{/isFloat}}
|
{{/isFloat}}
|
||||||
{{#isLong}}
|
{{#isLong}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetInt64();
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetInt64();
|
||||||
{{/isLong}}
|
{{/isLong}}
|
||||||
{{^isLong}}
|
{{^isLong}}
|
||||||
{{^isFloat}}
|
{{^isFloat}}
|
||||||
{{^isDecimal}}
|
{{^isDecimal}}
|
||||||
{{^isDouble}}
|
{{^isDouble}}
|
||||||
{{#isNullable}}
|
{{#isNullable}}
|
||||||
if (reader.TokenType != JsonTokenType.Null)
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetInt32();
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetInt32();
|
||||||
{{/isNullable}}
|
{{/isNullable}}
|
||||||
{{^isNullable}}
|
{{^isNullable}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetInt32();
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetInt32();
|
||||||
{{/isNullable}}
|
{{/isNullable}}
|
||||||
{{/isDouble}}
|
{{/isDouble}}
|
||||||
{{/isDecimal}}
|
{{/isDecimal}}
|
||||||
@ -102,18 +102,18 @@
|
|||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
{{/isNumeric}}
|
{{/isNumeric}}
|
||||||
{{#isDate}}
|
{{#isDate}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<DateTime{{#isNullable}}?{{/isNullable}}>(ref reader, options);
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<DateTime{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
{{/isDate}}
|
{{/isDate}}
|
||||||
{{#isDateTime}}
|
{{#isDateTime}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<DateTime{{#isNullable}}?{{/isNullable}}>(ref reader, options);
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<DateTime{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
{{/isDateTime}}
|
{{/isDateTime}}
|
||||||
{{#isEnum}}
|
{{#isEnum}}
|
||||||
{{^isMap}}
|
{{^isMap}}
|
||||||
{{#isNumeric}}
|
{{#isNumeric}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = ({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}) reader.GetInt32();
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = ({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}) utf8JsonReader.GetInt32();
|
||||||
{{/isNumeric}}
|
{{/isNumeric}}
|
||||||
{{^isNumeric}}
|
{{^isNumeric}}
|
||||||
string {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}RawValue = reader.GetString();
|
string {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}RawValue = utf8JsonReader.GetString();
|
||||||
{{^isInnerEnum}}
|
{{^isInnerEnum}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{{datatypeWithEnum}}}Converter.FromString{{#isNullable}}OrDefault{{/isNullable}}({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}RawValue);
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{{datatypeWithEnum}}}Converter.FromString{{#isNullable}}OrDefault{{/isNullable}}({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}RawValue);
|
||||||
{{/isInnerEnum}}
|
{{/isInnerEnum}}
|
||||||
@ -124,7 +124,7 @@
|
|||||||
{{/isMap}}
|
{{/isMap}}
|
||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
{{#isUuid}}
|
{{#isUuid}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetGuid();
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetGuid();
|
||||||
{{/isUuid}}
|
{{/isUuid}}
|
||||||
{{^isUuid}}
|
{{^isUuid}}
|
||||||
{{^isEnum}}
|
{{^isEnum}}
|
||||||
@ -133,7 +133,7 @@
|
|||||||
{{^isNumeric}}
|
{{^isNumeric}}
|
||||||
{{^isDate}}
|
{{^isDate}}
|
||||||
{{^isDateTime}}
|
{{^isDateTime}}
|
||||||
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref reader, options);
|
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
{{/isDateTime}}
|
{{/isDateTime}}
|
||||||
{{/isDate}}
|
{{/isDate}}
|
||||||
{{/isNumeric}}
|
{{/isNumeric}}
|
||||||
@ -167,9 +167,9 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="{{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}"></param>
|
/// <param name="{{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
@ -209,11 +209,11 @@
|
|||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
{{#isDate}}
|
{{#isDate}}
|
||||||
writer.WritePropertyName("{{baseName}}");
|
writer.WritePropertyName("{{baseName}}");
|
||||||
JsonSerializer.Serialize(writer, {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{name}}, options);
|
JsonSerializer.Serialize(writer, {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{name}}, jsonSerializerOptions);
|
||||||
{{/isDate}}
|
{{/isDate}}
|
||||||
{{#isDateTime}}
|
{{#isDateTime}}
|
||||||
writer.WritePropertyName("{{baseName}}");
|
writer.WritePropertyName("{{baseName}}");
|
||||||
JsonSerializer.Serialize(writer, {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{name}}, options);
|
JsonSerializer.Serialize(writer, {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{name}}, jsonSerializerOptions);
|
||||||
{{/isDateTime}}
|
{{/isDateTime}}
|
||||||
{{#isEnum}}
|
{{#isEnum}}
|
||||||
{{#isNumeric}}
|
{{#isNumeric}}
|
||||||
@ -253,7 +253,7 @@
|
|||||||
{{^isDate}}
|
{{^isDate}}
|
||||||
{{^isDateTime}}
|
{{^isDateTime}}
|
||||||
writer.WritePropertyName("{{baseName}}");
|
writer.WritePropertyName("{{baseName}}");
|
||||||
JsonSerializer.Serialize(writer, {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{name}}, options);
|
JsonSerializer.Serialize(writer, {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{name}}, jsonSerializerOptions);
|
||||||
{{/isDateTime}}
|
{{/isDateTime}}
|
||||||
{{/isDate}}
|
{{/isDate}}
|
||||||
{{/isNumeric}}
|
{{/isNumeric}}
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Activity Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Activity Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Dictionary<string, List<ActivityOutputElementRepresentation>> activityOutputs = default;
|
Dictionary<string, List<ActivityOutputElementRepresentation>> activityOutputs = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "activity_outputs":
|
case "activity_outputs":
|
||||||
activityOutputs = JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref reader, options);
|
activityOutputs = JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,14 +141,14 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="activity"></param>
|
/// <param name="activity"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("activity_outputs");
|
writer.WritePropertyName("activity_outputs");
|
||||||
JsonSerializer.Serialize(writer, activity.ActivityOutputs, options);
|
JsonSerializer.Serialize(writer, activity.ActivityOutputs, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -105,43 +105,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ActivityOutputElementRepresentation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ActivityOutputElementRepresentation Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string prop1 = default;
|
string prop1 = default;
|
||||||
Object prop2 = default;
|
Object prop2 = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "prop1":
|
case "prop1":
|
||||||
prop1 = reader.GetString();
|
prop1 = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "prop2":
|
case "prop2":
|
||||||
prop2 = JsonSerializer.Deserialize<Object>(ref reader, options);
|
prop2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -157,15 +157,15 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="activityOutputElementRepresentation"></param>
|
/// <param name="activityOutputElementRepresentation"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WriteString("prop1", activityOutputElementRepresentation.Prop1);
|
writer.WriteString("prop1", activityOutputElementRepresentation.Prop1);
|
||||||
writer.WritePropertyName("prop2");
|
writer.WritePropertyName("prop2");
|
||||||
JsonSerializer.Serialize(writer, activityOutputElementRepresentation.Prop2, options);
|
JsonSerializer.Serialize(writer, activityOutputElementRepresentation.Prop2, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -175,19 +175,19 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override AdditionalPropertiesClass Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override AdditionalPropertiesClass Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Object emptyMap = default;
|
Object emptyMap = default;
|
||||||
Dictionary<string, Dictionary<string, string>> mapOfMapProperty = default;
|
Dictionary<string, Dictionary<string, string>> mapOfMapProperty = default;
|
||||||
@ -198,44 +198,44 @@ namespace Org.OpenAPITools.Model
|
|||||||
Dictionary<string, string> mapWithUndeclaredPropertiesString = default;
|
Dictionary<string, string> mapWithUndeclaredPropertiesString = default;
|
||||||
Object anytype1 = default;
|
Object anytype1 = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "empty_map":
|
case "empty_map":
|
||||||
emptyMap = JsonSerializer.Deserialize<Object>(ref reader, options);
|
emptyMap = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_of_map_property":
|
case "map_of_map_property":
|
||||||
mapOfMapProperty = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref reader, options);
|
mapOfMapProperty = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_property":
|
case "map_property":
|
||||||
mapProperty = JsonSerializer.Deserialize<Dictionary<string, string>>(ref reader, options);
|
mapProperty = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_with_undeclared_properties_anytype_1":
|
case "map_with_undeclared_properties_anytype_1":
|
||||||
mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize<Object>(ref reader, options);
|
mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_with_undeclared_properties_anytype_2":
|
case "map_with_undeclared_properties_anytype_2":
|
||||||
mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize<Object>(ref reader, options);
|
mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_with_undeclared_properties_anytype_3":
|
case "map_with_undeclared_properties_anytype_3":
|
||||||
mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref reader, options);
|
mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_with_undeclared_properties_string":
|
case "map_with_undeclared_properties_string":
|
||||||
mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize<Dictionary<string, string>>(ref reader, options);
|
mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "anytype_1":
|
case "anytype_1":
|
||||||
anytype1 = JsonSerializer.Deserialize<Object>(ref reader, options);
|
anytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -251,28 +251,28 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="additionalPropertiesClass"></param>
|
/// <param name="additionalPropertiesClass"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("empty_map");
|
writer.WritePropertyName("empty_map");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.EmptyMap, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.EmptyMap, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_of_map_property");
|
writer.WritePropertyName("map_of_map_property");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapOfMapProperty, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapOfMapProperty, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_property");
|
writer.WritePropertyName("map_property");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapProperty, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapProperty, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_with_undeclared_properties_anytype_1");
|
writer.WritePropertyName("map_with_undeclared_properties_anytype_1");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_with_undeclared_properties_anytype_2");
|
writer.WritePropertyName("map_with_undeclared_properties_anytype_2");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_with_undeclared_properties_anytype_3");
|
writer.WritePropertyName("map_with_undeclared_properties_anytype_3");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_with_undeclared_properties_string");
|
writer.WritePropertyName("map_with_undeclared_properties_string");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesString, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesString, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("anytype_1");
|
writer.WritePropertyName("anytype_1");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.Anytype1, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.Anytype1, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -115,43 +115,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Animal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Animal Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string className = default;
|
string className = default;
|
||||||
string color = default;
|
string color = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "className":
|
case "className":
|
||||||
className = reader.GetString();
|
className = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "color":
|
case "color":
|
||||||
color = reader.GetString();
|
color = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -167,9 +167,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="animal"></param>
|
/// <param name="animal"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -117,47 +117,47 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ApiResponse Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ApiResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
int code = default;
|
int code = default;
|
||||||
string message = default;
|
string message = default;
|
||||||
string type = default;
|
string type = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "code":
|
case "code":
|
||||||
code = reader.GetInt32();
|
code = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "message":
|
case "message":
|
||||||
message = reader.GetString();
|
message = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "type":
|
case "type":
|
||||||
type = reader.GetString();
|
type = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -173,9 +173,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="apiResponse"></param>
|
/// <param name="apiResponse"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -119,43 +119,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Apple Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Apple Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string cultivar = default;
|
string cultivar = default;
|
||||||
string origin = default;
|
string origin = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "cultivar":
|
case "cultivar":
|
||||||
cultivar = reader.GetString();
|
cultivar = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "origin":
|
case "origin":
|
||||||
origin = reader.GetString();
|
origin = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -171,9 +171,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="apple"></param>
|
/// <param name="apple"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -98,43 +98,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override AppleReq Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override AppleReq Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string cultivar = default;
|
string cultivar = default;
|
||||||
bool mealy = default;
|
bool mealy = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "cultivar":
|
case "cultivar":
|
||||||
cultivar = reader.GetString();
|
cultivar = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "mealy":
|
case "mealy":
|
||||||
mealy = reader.GetBoolean();
|
mealy = utf8JsonReader.GetBoolean();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -150,9 +150,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="appleReq"></param>
|
/// <param name="appleReq"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ArrayOfArrayOfNumberOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ArrayOfArrayOfNumberOnly Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
List<List<decimal>> arrayArrayNumber = default;
|
List<List<decimal>> arrayArrayNumber = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "ArrayArrayNumber":
|
case "ArrayArrayNumber":
|
||||||
arrayArrayNumber = JsonSerializer.Deserialize<List<List<decimal>>>(ref reader, options);
|
arrayArrayNumber = JsonSerializer.Deserialize<List<List<decimal>>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,14 +141,14 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="arrayOfArrayOfNumberOnly"></param>
|
/// <param name="arrayOfArrayOfNumberOnly"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("ArrayArrayNumber");
|
writer.WritePropertyName("ArrayArrayNumber");
|
||||||
JsonSerializer.Serialize(writer, arrayOfArrayOfNumberOnly.ArrayArrayNumber, options);
|
JsonSerializer.Serialize(writer, arrayOfArrayOfNumberOnly.ArrayArrayNumber, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ArrayOfNumberOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ArrayOfNumberOnly Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
List<decimal> arrayNumber = default;
|
List<decimal> arrayNumber = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "ArrayNumber":
|
case "ArrayNumber":
|
||||||
arrayNumber = JsonSerializer.Deserialize<List<decimal>>(ref reader, options);
|
arrayNumber = JsonSerializer.Deserialize<List<decimal>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,14 +141,14 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="arrayOfNumberOnly"></param>
|
/// <param name="arrayOfNumberOnly"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("ArrayNumber");
|
writer.WritePropertyName("ArrayNumber");
|
||||||
JsonSerializer.Serialize(writer, arrayOfNumberOnly.ArrayNumber, options);
|
JsonSerializer.Serialize(writer, arrayOfNumberOnly.ArrayNumber, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -117,47 +117,47 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ArrayTest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ArrayTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
List<List<long>> arrayArrayOfInteger = default;
|
List<List<long>> arrayArrayOfInteger = default;
|
||||||
List<List<ReadOnlyFirst>> arrayArrayOfModel = default;
|
List<List<ReadOnlyFirst>> arrayArrayOfModel = default;
|
||||||
List<string> arrayOfString = default;
|
List<string> arrayOfString = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "array_array_of_integer":
|
case "array_array_of_integer":
|
||||||
arrayArrayOfInteger = JsonSerializer.Deserialize<List<List<long>>>(ref reader, options);
|
arrayArrayOfInteger = JsonSerializer.Deserialize<List<List<long>>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "array_array_of_model":
|
case "array_array_of_model":
|
||||||
arrayArrayOfModel = JsonSerializer.Deserialize<List<List<ReadOnlyFirst>>>(ref reader, options);
|
arrayArrayOfModel = JsonSerializer.Deserialize<List<List<ReadOnlyFirst>>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "array_of_string":
|
case "array_of_string":
|
||||||
arrayOfString = JsonSerializer.Deserialize<List<string>>(ref reader, options);
|
arrayOfString = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -173,18 +173,18 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="arrayTest"></param>
|
/// <param name="arrayTest"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("array_array_of_integer");
|
writer.WritePropertyName("array_array_of_integer");
|
||||||
JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfInteger, options);
|
JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfInteger, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("array_array_of_model");
|
writer.WritePropertyName("array_array_of_model");
|
||||||
JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfModel, options);
|
JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfModel, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("array_of_string");
|
writer.WritePropertyName("array_of_string");
|
||||||
JsonSerializer.Serialize(writer, arrayTest.ArrayOfString, options);
|
JsonSerializer.Serialize(writer, arrayTest.ArrayOfString, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Banana Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Banana Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
decimal lengthCm = default;
|
decimal lengthCm = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "lengthCm":
|
case "lengthCm":
|
||||||
lengthCm = reader.GetInt32();
|
lengthCm = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="banana"></param>
|
/// <param name="banana"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -98,43 +98,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override BananaReq Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override BananaReq Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
decimal lengthCm = default;
|
decimal lengthCm = default;
|
||||||
bool sweet = default;
|
bool sweet = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "lengthCm":
|
case "lengthCm":
|
||||||
lengthCm = reader.GetInt32();
|
lengthCm = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "sweet":
|
case "sweet":
|
||||||
sweet = reader.GetBoolean();
|
sweet = utf8JsonReader.GetBoolean();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -150,9 +150,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="bananaReq"></param>
|
/// <param name="bananaReq"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override BasquePig Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override BasquePig Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string className = default;
|
string className = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "className":
|
case "className":
|
||||||
className = reader.GetString();
|
className = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="basquePig"></param>
|
/// <param name="basquePig"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -154,19 +154,19 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Capitalization Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string aTTNAME = default;
|
string aTTNAME = default;
|
||||||
string capitalCamel = default;
|
string capitalCamel = default;
|
||||||
@ -175,38 +175,38 @@ namespace Org.OpenAPITools.Model
|
|||||||
string smallCamel = default;
|
string smallCamel = default;
|
||||||
string smallSnake = default;
|
string smallSnake = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "ATT_NAME":
|
case "ATT_NAME":
|
||||||
aTTNAME = reader.GetString();
|
aTTNAME = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "CapitalCamel":
|
case "CapitalCamel":
|
||||||
capitalCamel = reader.GetString();
|
capitalCamel = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "Capital_Snake":
|
case "Capital_Snake":
|
||||||
capitalSnake = reader.GetString();
|
capitalSnake = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "SCA_ETH_Flow_Points":
|
case "SCA_ETH_Flow_Points":
|
||||||
sCAETHFlowPoints = reader.GetString();
|
sCAETHFlowPoints = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "smallCamel":
|
case "smallCamel":
|
||||||
smallCamel = reader.GetString();
|
smallCamel = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "small_Snake":
|
case "small_Snake":
|
||||||
smallSnake = reader.GetString();
|
smallSnake = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -222,9 +222,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="capitalization"></param>
|
/// <param name="capitalization"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -76,49 +76,49 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Cat Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Cat Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader dictionaryReader = reader;
|
Utf8JsonReader dictionaryReader = utf8JsonReader;
|
||||||
bool dictionaryDeserialized = Client.ClientUtils.TryDeserialize<Dictionary<string, int>>(ref reader, options, out Dictionary<string, int>? dictionary);
|
bool dictionaryDeserialized = Client.ClientUtils.TryDeserialize<Dictionary<string, int>>(ref utf8JsonReader, jsonSerializerOptions, out Dictionary<string, int>? dictionary);
|
||||||
|
|
||||||
Utf8JsonReader catAllOfReader = reader;
|
Utf8JsonReader catAllOfReader = utf8JsonReader;
|
||||||
bool catAllOfDeserialized = Client.ClientUtils.TryDeserialize<CatAllOf>(ref reader, options, out CatAllOf? catAllOf);
|
bool catAllOfDeserialized = Client.ClientUtils.TryDeserialize<CatAllOf>(ref utf8JsonReader, jsonSerializerOptions, out CatAllOf? catAllOf);
|
||||||
|
|
||||||
string className = default;
|
string className = default;
|
||||||
string color = default;
|
string color = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "className":
|
case "className":
|
||||||
className = reader.GetString();
|
className = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "color":
|
case "color":
|
||||||
color = reader.GetString();
|
color = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -134,9 +134,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="cat"></param>
|
/// <param name="cat"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override CatAllOf Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override CatAllOf Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
bool declawed = default;
|
bool declawed = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "declawed":
|
case "declawed":
|
||||||
declawed = reader.GetBoolean();
|
declawed = utf8JsonReader.GetBoolean();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="catAllOf"></param>
|
/// <param name="catAllOf"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, CatAllOf catAllOf, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, CatAllOf catAllOf, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -105,43 +105,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Category Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Category Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
long id = default;
|
long id = default;
|
||||||
string name = default;
|
string name = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "id":
|
case "id":
|
||||||
id = reader.GetInt64();
|
id = utf8JsonReader.GetInt64();
|
||||||
break;
|
break;
|
||||||
case "name":
|
case "name":
|
||||||
name = reader.GetString();
|
name = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -157,9 +157,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="category"></param>
|
/// <param name="category"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Category category, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -68,42 +68,42 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ChildCat Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ChildCat Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader childCatAllOfReader = reader;
|
Utf8JsonReader childCatAllOfReader = utf8JsonReader;
|
||||||
bool childCatAllOfDeserialized = Client.ClientUtils.TryDeserialize<ChildCatAllOf>(ref reader, options, out ChildCatAllOf? childCatAllOf);
|
bool childCatAllOfDeserialized = Client.ClientUtils.TryDeserialize<ChildCatAllOf>(ref utf8JsonReader, jsonSerializerOptions, out ChildCatAllOf? childCatAllOf);
|
||||||
|
|
||||||
string petType = default;
|
string petType = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "pet_type":
|
case "pet_type":
|
||||||
petType = reader.GetString();
|
petType = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -119,9 +119,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="childCat"></param>
|
/// <param name="childCat"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -144,43 +144,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ChildCatAllOf Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ChildCatAllOf Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string name = default;
|
string name = default;
|
||||||
ChildCatAllOf.PetTypeEnum petType = default;
|
ChildCatAllOf.PetTypeEnum petType = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "name":
|
case "name":
|
||||||
name = reader.GetString();
|
name = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "pet_type":
|
case "pet_type":
|
||||||
string petTypeRawValue = reader.GetString();
|
string petTypeRawValue = utf8JsonReader.GetString();
|
||||||
petType = ChildCatAllOf.PetTypeEnumFromString(petTypeRawValue);
|
petType = ChildCatAllOf.PetTypeEnumFromString(petTypeRawValue);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -197,9 +197,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="childCatAllOf"></param>
|
/// <param name="childCatAllOf"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ChildCatAllOf childCatAllOf, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ChildCatAllOf childCatAllOf, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ClassModel Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ClassModel Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string classProperty = default;
|
string classProperty = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "_class":
|
case "_class":
|
||||||
classProperty = reader.GetString();
|
classProperty = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="classModel"></param>
|
/// <param name="classModel"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -89,39 +89,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ComplexQuadrilateral Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ComplexQuadrilateral Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader shapeInterfaceReader = reader;
|
Utf8JsonReader shapeInterfaceReader = utf8JsonReader;
|
||||||
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref reader, options, out ShapeInterface? shapeInterface);
|
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref utf8JsonReader, jsonSerializerOptions, out ShapeInterface? shapeInterface);
|
||||||
|
|
||||||
Utf8JsonReader quadrilateralInterfaceReader = reader;
|
Utf8JsonReader quadrilateralInterfaceReader = utf8JsonReader;
|
||||||
bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize<QuadrilateralInterface>(ref reader, options, out QuadrilateralInterface? quadrilateralInterface);
|
bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize<QuadrilateralInterface>(ref utf8JsonReader, jsonSerializerOptions, out QuadrilateralInterface? quadrilateralInterface);
|
||||||
|
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -139,9 +139,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="complexQuadrilateral"></param>
|
/// <param name="complexQuadrilateral"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override DanishPig Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override DanishPig Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string className = default;
|
string className = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "className":
|
case "className":
|
||||||
className = reader.GetString();
|
className = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="danishPig"></param>
|
/// <param name="danishPig"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override DeprecatedObject Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override DeprecatedObject Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string name = default;
|
string name = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "name":
|
case "name":
|
||||||
name = reader.GetString();
|
name = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="deprecatedObject"></param>
|
/// <param name="deprecatedObject"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -69,46 +69,46 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Dog Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Dog Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader dogAllOfReader = reader;
|
Utf8JsonReader dogAllOfReader = utf8JsonReader;
|
||||||
bool dogAllOfDeserialized = Client.ClientUtils.TryDeserialize<DogAllOf>(ref reader, options, out DogAllOf? dogAllOf);
|
bool dogAllOfDeserialized = Client.ClientUtils.TryDeserialize<DogAllOf>(ref utf8JsonReader, jsonSerializerOptions, out DogAllOf? dogAllOf);
|
||||||
|
|
||||||
string className = default;
|
string className = default;
|
||||||
string color = default;
|
string color = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "className":
|
case "className":
|
||||||
className = reader.GetString();
|
className = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "color":
|
case "color":
|
||||||
color = reader.GetString();
|
color = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -124,9 +124,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="dog"></param>
|
/// <param name="dog"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override DogAllOf Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override DogAllOf Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string breed = default;
|
string breed = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "breed":
|
case "breed":
|
||||||
breed = reader.GetString();
|
breed = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="dogAllOf"></param>
|
/// <param name="dogAllOf"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, DogAllOf dogAllOf, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, DogAllOf dogAllOf, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -120,51 +120,51 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Drawing Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Drawing Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Shape mainShape = default;
|
Shape mainShape = default;
|
||||||
ShapeOrNull shapeOrNull = default;
|
ShapeOrNull shapeOrNull = default;
|
||||||
List<Shape> shapes = default;
|
List<Shape> shapes = default;
|
||||||
NullableShape nullableShape = default;
|
NullableShape nullableShape = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "mainShape":
|
case "mainShape":
|
||||||
mainShape = JsonSerializer.Deserialize<Shape>(ref reader, options);
|
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "shapeOrNull":
|
case "shapeOrNull":
|
||||||
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref reader, options);
|
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "shapes":
|
case "shapes":
|
||||||
shapes = JsonSerializer.Deserialize<List<Shape>>(ref reader, options);
|
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "nullableShape":
|
case "nullableShape":
|
||||||
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref reader, options);
|
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -180,20 +180,20 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="drawing"></param>
|
/// <param name="drawing"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("mainShape");
|
writer.WritePropertyName("mainShape");
|
||||||
JsonSerializer.Serialize(writer, drawing.MainShape, options);
|
JsonSerializer.Serialize(writer, drawing.MainShape, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("shapeOrNull");
|
writer.WritePropertyName("shapeOrNull");
|
||||||
JsonSerializer.Serialize(writer, drawing.ShapeOrNull, options);
|
JsonSerializer.Serialize(writer, drawing.ShapeOrNull, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("shapes");
|
writer.WritePropertyName("shapes");
|
||||||
JsonSerializer.Serialize(writer, drawing.Shapes, options);
|
JsonSerializer.Serialize(writer, drawing.Shapes, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("nullableShape");
|
writer.WritePropertyName("nullableShape");
|
||||||
JsonSerializer.Serialize(writer, drawing.NullableShape, options);
|
JsonSerializer.Serialize(writer, drawing.NullableShape, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -205,43 +205,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override EnumArrays Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override EnumArrays Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
List<EnumArrays.ArrayEnumEnum> arrayEnum = default;
|
List<EnumArrays.ArrayEnumEnum> arrayEnum = default;
|
||||||
EnumArrays.JustSymbolEnum justSymbol = default;
|
EnumArrays.JustSymbolEnum justSymbol = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "array_enum":
|
case "array_enum":
|
||||||
arrayEnum = JsonSerializer.Deserialize<List<EnumArrays.ArrayEnumEnum>>(ref reader, options);
|
arrayEnum = JsonSerializer.Deserialize<List<EnumArrays.ArrayEnumEnum>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "just_symbol":
|
case "just_symbol":
|
||||||
string justSymbolRawValue = reader.GetString();
|
string justSymbolRawValue = utf8JsonReader.GetString();
|
||||||
justSymbol = EnumArrays.JustSymbolEnumFromString(justSymbolRawValue);
|
justSymbol = EnumArrays.JustSymbolEnumFromString(justSymbolRawValue);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -258,14 +258,14 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="enumArrays"></param>
|
/// <param name="enumArrays"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("array_enum");
|
writer.WritePropertyName("array_enum");
|
||||||
JsonSerializer.Serialize(writer, enumArrays.ArrayEnum, options);
|
JsonSerializer.Serialize(writer, enumArrays.ArrayEnum, jsonSerializerOptions);
|
||||||
var justSymbolRawValue = EnumArrays.JustSymbolEnumToJsonValue(enumArrays.JustSymbol);
|
var justSymbolRawValue = EnumArrays.JustSymbolEnumToJsonValue(enumArrays.JustSymbol);
|
||||||
if (justSymbolRawValue != null)
|
if (justSymbolRawValue != null)
|
||||||
writer.WriteString("just_symbol", justSymbolRawValue);
|
writer.WriteString("just_symbol", justSymbolRawValue);
|
||||||
|
@ -446,19 +446,19 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override EnumTest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override EnumTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
EnumTest.EnumIntegerEnum enumInteger = default;
|
EnumTest.EnumIntegerEnum enumInteger = default;
|
||||||
EnumTest.EnumIntegerOnlyEnum enumIntegerOnly = default;
|
EnumTest.EnumIntegerOnlyEnum enumIntegerOnly = default;
|
||||||
@ -470,52 +470,52 @@ namespace Org.OpenAPITools.Model
|
|||||||
OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = default;
|
OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = default;
|
||||||
OuterEnum? outerEnum = default;
|
OuterEnum? outerEnum = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "enum_integer":
|
case "enum_integer":
|
||||||
enumInteger = (EnumTest.EnumIntegerEnum) reader.GetInt32();
|
enumInteger = (EnumTest.EnumIntegerEnum) utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "enum_integer_only":
|
case "enum_integer_only":
|
||||||
enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum) reader.GetInt32();
|
enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum) utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "enum_number":
|
case "enum_number":
|
||||||
enumNumber = (EnumTest.EnumNumberEnum) reader.GetInt32();
|
enumNumber = (EnumTest.EnumNumberEnum) utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "enum_string":
|
case "enum_string":
|
||||||
string enumStringRawValue = reader.GetString();
|
string enumStringRawValue = utf8JsonReader.GetString();
|
||||||
enumString = EnumTest.EnumStringEnumFromString(enumStringRawValue);
|
enumString = EnumTest.EnumStringEnumFromString(enumStringRawValue);
|
||||||
break;
|
break;
|
||||||
case "enum_string_required":
|
case "enum_string_required":
|
||||||
string enumStringRequiredRawValue = reader.GetString();
|
string enumStringRequiredRawValue = utf8JsonReader.GetString();
|
||||||
enumStringRequired = EnumTest.EnumStringRequiredEnumFromString(enumStringRequiredRawValue);
|
enumStringRequired = EnumTest.EnumStringRequiredEnumFromString(enumStringRequiredRawValue);
|
||||||
break;
|
break;
|
||||||
case "outerEnumDefaultValue":
|
case "outerEnumDefaultValue":
|
||||||
string outerEnumDefaultValueRawValue = reader.GetString();
|
string outerEnumDefaultValueRawValue = utf8JsonReader.GetString();
|
||||||
outerEnumDefaultValue = OuterEnumDefaultValueConverter.FromString(outerEnumDefaultValueRawValue);
|
outerEnumDefaultValue = OuterEnumDefaultValueConverter.FromString(outerEnumDefaultValueRawValue);
|
||||||
break;
|
break;
|
||||||
case "outerEnumInteger":
|
case "outerEnumInteger":
|
||||||
string outerEnumIntegerRawValue = reader.GetString();
|
string outerEnumIntegerRawValue = utf8JsonReader.GetString();
|
||||||
outerEnumInteger = OuterEnumIntegerConverter.FromString(outerEnumIntegerRawValue);
|
outerEnumInteger = OuterEnumIntegerConverter.FromString(outerEnumIntegerRawValue);
|
||||||
break;
|
break;
|
||||||
case "outerEnumIntegerDefaultValue":
|
case "outerEnumIntegerDefaultValue":
|
||||||
string outerEnumIntegerDefaultValueRawValue = reader.GetString();
|
string outerEnumIntegerDefaultValueRawValue = utf8JsonReader.GetString();
|
||||||
outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValueConverter.FromString(outerEnumIntegerDefaultValueRawValue);
|
outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValueConverter.FromString(outerEnumIntegerDefaultValueRawValue);
|
||||||
break;
|
break;
|
||||||
case "outerEnum":
|
case "outerEnum":
|
||||||
string outerEnumRawValue = reader.GetString();
|
string outerEnumRawValue = utf8JsonReader.GetString();
|
||||||
outerEnum = OuterEnumConverter.FromStringOrDefault(outerEnumRawValue);
|
outerEnum = OuterEnumConverter.FromStringOrDefault(outerEnumRawValue);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -532,9 +532,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="enumTest"></param>
|
/// <param name="enumTest"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -89,39 +89,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override EquilateralTriangle Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override EquilateralTriangle Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader shapeInterfaceReader = reader;
|
Utf8JsonReader shapeInterfaceReader = utf8JsonReader;
|
||||||
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref reader, options, out ShapeInterface? shapeInterface);
|
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref utf8JsonReader, jsonSerializerOptions, out ShapeInterface? shapeInterface);
|
||||||
|
|
||||||
Utf8JsonReader triangleInterfaceReader = reader;
|
Utf8JsonReader triangleInterfaceReader = utf8JsonReader;
|
||||||
bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize<TriangleInterface>(ref reader, options, out TriangleInterface? triangleInterface);
|
bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize<TriangleInterface>(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface? triangleInterface);
|
||||||
|
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -139,9 +139,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="equilateralTriangle"></param>
|
/// <param name="equilateralTriangle"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -94,39 +94,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override File Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override File Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string sourceURI = default;
|
string sourceURI = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "sourceURI":
|
case "sourceURI":
|
||||||
sourceURI = reader.GetString();
|
sourceURI = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -142,9 +142,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="file"></param>
|
/// <param name="file"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, File file, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -105,43 +105,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override FileSchemaTestClass Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override FileSchemaTestClass Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
File file = default;
|
File file = default;
|
||||||
List<File> files = default;
|
List<File> files = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "file":
|
case "file":
|
||||||
file = JsonSerializer.Deserialize<File>(ref reader, options);
|
file = JsonSerializer.Deserialize<File>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "files":
|
case "files":
|
||||||
files = JsonSerializer.Deserialize<List<File>>(ref reader, options);
|
files = JsonSerializer.Deserialize<List<File>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -157,16 +157,16 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="fileSchemaTestClass"></param>
|
/// <param name="fileSchemaTestClass"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("file");
|
writer.WritePropertyName("file");
|
||||||
JsonSerializer.Serialize(writer, fileSchemaTestClass.File, options);
|
JsonSerializer.Serialize(writer, fileSchemaTestClass.File, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("files");
|
writer.WritePropertyName("files");
|
||||||
JsonSerializer.Serialize(writer, fileSchemaTestClass.Files, options);
|
JsonSerializer.Serialize(writer, fileSchemaTestClass.Files, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Foo Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Foo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string bar = default;
|
string bar = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "bar":
|
case "bar":
|
||||||
bar = reader.GetString();
|
bar = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="foo"></param>
|
/// <param name="foo"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Foo foo, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override FooGetDefaultResponse Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override FooGetDefaultResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Foo stringProperty = default;
|
Foo stringProperty = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "string":
|
case "string":
|
||||||
stringProperty = JsonSerializer.Deserialize<Foo>(ref reader, options);
|
stringProperty = JsonSerializer.Deserialize<Foo>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,14 +141,14 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="fooGetDefaultResponse"></param>
|
/// <param name="fooGetDefaultResponse"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("string");
|
writer.WritePropertyName("string");
|
||||||
JsonSerializer.Serialize(writer, fooGetDefaultResponse.StringProperty, options);
|
JsonSerializer.Serialize(writer, fooGetDefaultResponse.StringProperty, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -368,19 +368,19 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override FormatTest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
System.IO.Stream binary = default;
|
System.IO.Stream binary = default;
|
||||||
byte[] byteProperty = default;
|
byte[] byteProperty = default;
|
||||||
@ -399,68 +399,68 @@ namespace Org.OpenAPITools.Model
|
|||||||
string stringProperty = default;
|
string stringProperty = default;
|
||||||
Guid uuid = default;
|
Guid uuid = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "binary":
|
case "binary":
|
||||||
binary = JsonSerializer.Deserialize<System.IO.Stream>(ref reader, options);
|
binary = JsonSerializer.Deserialize<System.IO.Stream>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "byte":
|
case "byte":
|
||||||
byteProperty = JsonSerializer.Deserialize<byte[]>(ref reader, options);
|
byteProperty = JsonSerializer.Deserialize<byte[]>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "date":
|
case "date":
|
||||||
date = JsonSerializer.Deserialize<DateTime>(ref reader, options);
|
date = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "dateTime":
|
case "dateTime":
|
||||||
dateTime = JsonSerializer.Deserialize<DateTime>(ref reader, options);
|
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "decimal":
|
case "decimal":
|
||||||
decimalProperty = JsonSerializer.Deserialize<decimal>(ref reader, options);
|
decimalProperty = JsonSerializer.Deserialize<decimal>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "double":
|
case "double":
|
||||||
doubleProperty = reader.GetDouble();
|
doubleProperty = utf8JsonReader.GetDouble();
|
||||||
break;
|
break;
|
||||||
case "float":
|
case "float":
|
||||||
floatProperty = (float)reader.GetDouble();
|
floatProperty = (float)utf8JsonReader.GetDouble();
|
||||||
break;
|
break;
|
||||||
case "int32":
|
case "int32":
|
||||||
int32 = reader.GetInt32();
|
int32 = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "int64":
|
case "int64":
|
||||||
int64 = reader.GetInt64();
|
int64 = utf8JsonReader.GetInt64();
|
||||||
break;
|
break;
|
||||||
case "integer":
|
case "integer":
|
||||||
integer = reader.GetInt32();
|
integer = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "number":
|
case "number":
|
||||||
number = reader.GetInt32();
|
number = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "password":
|
case "password":
|
||||||
password = reader.GetString();
|
password = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "pattern_with_digits":
|
case "pattern_with_digits":
|
||||||
patternWithDigits = reader.GetString();
|
patternWithDigits = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "pattern_with_digits_and_delimiter":
|
case "pattern_with_digits_and_delimiter":
|
||||||
patternWithDigitsAndDelimiter = reader.GetString();
|
patternWithDigitsAndDelimiter = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "string":
|
case "string":
|
||||||
stringProperty = reader.GetString();
|
stringProperty = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "uuid":
|
case "uuid":
|
||||||
uuid = reader.GetGuid();
|
uuid = utf8JsonReader.GetGuid();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -476,22 +476,22 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="formatTest"></param>
|
/// <param name="formatTest"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("binary");
|
writer.WritePropertyName("binary");
|
||||||
JsonSerializer.Serialize(writer, formatTest.Binary, options);
|
JsonSerializer.Serialize(writer, formatTest.Binary, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("byte");
|
writer.WritePropertyName("byte");
|
||||||
JsonSerializer.Serialize(writer, formatTest.ByteProperty, options);
|
JsonSerializer.Serialize(writer, formatTest.ByteProperty, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("date");
|
writer.WritePropertyName("date");
|
||||||
JsonSerializer.Serialize(writer, formatTest.Date, options);
|
JsonSerializer.Serialize(writer, formatTest.Date, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("dateTime");
|
writer.WritePropertyName("dateTime");
|
||||||
JsonSerializer.Serialize(writer, formatTest.DateTime, options);
|
JsonSerializer.Serialize(writer, formatTest.DateTime, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("decimal");
|
writer.WritePropertyName("decimal");
|
||||||
JsonSerializer.Serialize(writer, formatTest.DecimalProperty, options);
|
JsonSerializer.Serialize(writer, formatTest.DecimalProperty, jsonSerializerOptions);
|
||||||
writer.WriteNumber("double", formatTest.DoubleProperty);
|
writer.WriteNumber("double", formatTest.DoubleProperty);
|
||||||
writer.WriteNumber("float", formatTest.FloatProperty);
|
writer.WriteNumber("float", formatTest.FloatProperty);
|
||||||
writer.WriteNumber("int32", formatTest.Int32);
|
writer.WriteNumber("int32", formatTest.Int32);
|
||||||
|
@ -119,45 +119,45 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Fruit Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Fruit Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader appleReader = reader;
|
Utf8JsonReader appleReader = utf8JsonReader;
|
||||||
bool appleDeserialized = Client.ClientUtils.TryDeserialize<Apple>(ref appleReader, options, out Apple? apple);
|
bool appleDeserialized = Client.ClientUtils.TryDeserialize<Apple>(ref appleReader, jsonSerializerOptions, out Apple? apple);
|
||||||
|
|
||||||
Utf8JsonReader bananaReader = reader;
|
Utf8JsonReader bananaReader = utf8JsonReader;
|
||||||
bool bananaDeserialized = Client.ClientUtils.TryDeserialize<Banana>(ref bananaReader, options, out Banana? banana);
|
bool bananaDeserialized = Client.ClientUtils.TryDeserialize<Banana>(ref bananaReader, jsonSerializerOptions, out Banana? banana);
|
||||||
|
|
||||||
string color = default;
|
string color = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "color":
|
case "color":
|
||||||
color = reader.GetString();
|
color = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -179,9 +179,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="fruit"></param>
|
/// <param name="fruit"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -90,39 +90,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override FruitReq Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override FruitReq Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader appleReqReader = reader;
|
Utf8JsonReader appleReqReader = utf8JsonReader;
|
||||||
bool appleReqDeserialized = Client.ClientUtils.TryDeserialize<AppleReq>(ref appleReqReader, options, out AppleReq? appleReq);
|
bool appleReqDeserialized = Client.ClientUtils.TryDeserialize<AppleReq>(ref appleReqReader, jsonSerializerOptions, out AppleReq? appleReq);
|
||||||
|
|
||||||
Utf8JsonReader bananaReqReader = reader;
|
Utf8JsonReader bananaReqReader = utf8JsonReader;
|
||||||
bool bananaReqDeserialized = Client.ClientUtils.TryDeserialize<BananaReq>(ref bananaReqReader, options, out BananaReq? bananaReq);
|
bool bananaReqDeserialized = Client.ClientUtils.TryDeserialize<BananaReq>(ref bananaReqReader, jsonSerializerOptions, out BananaReq? bananaReq);
|
||||||
|
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -146,9 +146,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="fruitReq"></param>
|
/// <param name="fruitReq"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -100,45 +100,45 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override GmFruit Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override GmFruit Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader appleReader = reader;
|
Utf8JsonReader appleReader = utf8JsonReader;
|
||||||
bool appleDeserialized = Client.ClientUtils.TryDeserialize<Apple>(ref appleReader, options, out Apple? apple);
|
bool appleDeserialized = Client.ClientUtils.TryDeserialize<Apple>(ref appleReader, jsonSerializerOptions, out Apple? apple);
|
||||||
|
|
||||||
Utf8JsonReader bananaReader = reader;
|
Utf8JsonReader bananaReader = utf8JsonReader;
|
||||||
bool bananaDeserialized = Client.ClientUtils.TryDeserialize<Banana>(ref bananaReader, options, out Banana? banana);
|
bool bananaDeserialized = Client.ClientUtils.TryDeserialize<Banana>(ref bananaReader, jsonSerializerOptions, out Banana? banana);
|
||||||
|
|
||||||
string color = default;
|
string color = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "color":
|
case "color":
|
||||||
color = reader.GetString();
|
color = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -154,9 +154,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="gmFruit"></param>
|
/// <param name="gmFruit"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -103,39 +103,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override GrandparentAnimal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override GrandparentAnimal Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string petType = default;
|
string petType = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "pet_type":
|
case "pet_type":
|
||||||
petType = reader.GetString();
|
petType = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -151,9 +151,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="grandparentAnimal"></param>
|
/// <param name="grandparentAnimal"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -142,43 +142,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override HasOnlyReadOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override HasOnlyReadOnly Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string bar = default;
|
string bar = default;
|
||||||
string foo = default;
|
string foo = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "bar":
|
case "bar":
|
||||||
bar = reader.GetString();
|
bar = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "foo":
|
case "foo":
|
||||||
foo = reader.GetString();
|
foo = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -194,9 +194,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="hasOnlyReadOnly"></param>
|
/// <param name="hasOnlyReadOnly"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -84,39 +84,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override HealthCheckResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override HealthCheckResult Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string nullableMessage = default;
|
string nullableMessage = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "NullableMessage":
|
case "NullableMessage":
|
||||||
nullableMessage = reader.GetString();
|
nullableMessage = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -132,9 +132,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="healthCheckResult"></param>
|
/// <param name="healthCheckResult"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -82,39 +82,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override IsoscelesTriangle Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override IsoscelesTriangle Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader shapeInterfaceReader = reader;
|
Utf8JsonReader shapeInterfaceReader = utf8JsonReader;
|
||||||
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref reader, options, out ShapeInterface? shapeInterface);
|
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref utf8JsonReader, jsonSerializerOptions, out ShapeInterface? shapeInterface);
|
||||||
|
|
||||||
Utf8JsonReader triangleInterfaceReader = reader;
|
Utf8JsonReader triangleInterfaceReader = utf8JsonReader;
|
||||||
bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize<TriangleInterface>(ref reader, options, out TriangleInterface? triangleInterface);
|
bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize<TriangleInterface>(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface? triangleInterface);
|
||||||
|
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -132,9 +132,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="isoscelesTriangle"></param>
|
/// <param name="isoscelesTriangle"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override List Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override List Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string _123list = default;
|
string _123list = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "123-list":
|
case "123-list":
|
||||||
_123list = reader.GetString();
|
_123list = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="list"></param>
|
/// <param name="list"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, List list, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -122,42 +122,42 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Mammal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Mammal Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader whaleReader = reader;
|
Utf8JsonReader whaleReader = utf8JsonReader;
|
||||||
bool whaleDeserialized = Client.ClientUtils.TryDeserialize<Whale>(ref whaleReader, options, out Whale? whale);
|
bool whaleDeserialized = Client.ClientUtils.TryDeserialize<Whale>(ref whaleReader, jsonSerializerOptions, out Whale? whale);
|
||||||
|
|
||||||
Utf8JsonReader zebraReader = reader;
|
Utf8JsonReader zebraReader = utf8JsonReader;
|
||||||
bool zebraDeserialized = Client.ClientUtils.TryDeserialize<Zebra>(ref zebraReader, options, out Zebra? zebra);
|
bool zebraDeserialized = Client.ClientUtils.TryDeserialize<Zebra>(ref zebraReader, jsonSerializerOptions, out Zebra? zebra);
|
||||||
|
|
||||||
Utf8JsonReader pigReader = reader;
|
Utf8JsonReader pigReader = utf8JsonReader;
|
||||||
bool pigDeserialized = Client.ClientUtils.TryDeserialize<Pig>(ref pigReader, options, out Pig? pig);
|
bool pigDeserialized = Client.ClientUtils.TryDeserialize<Pig>(ref pigReader, jsonSerializerOptions, out Pig? pig);
|
||||||
|
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -184,9 +184,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="mammal"></param>
|
/// <param name="mammal"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -179,51 +179,51 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override MapTest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override MapTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Dictionary<string, bool> directMap = default;
|
Dictionary<string, bool> directMap = default;
|
||||||
Dictionary<string, bool> indirectMap = default;
|
Dictionary<string, bool> indirectMap = default;
|
||||||
Dictionary<string, Dictionary<string, string>> mapMapOfString = default;
|
Dictionary<string, Dictionary<string, string>> mapMapOfString = default;
|
||||||
Dictionary<string, MapTest.InnerEnum> mapOfEnumString = default;
|
Dictionary<string, MapTest.InnerEnum> mapOfEnumString = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "direct_map":
|
case "direct_map":
|
||||||
directMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref reader, options);
|
directMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "indirect_map":
|
case "indirect_map":
|
||||||
indirectMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref reader, options);
|
indirectMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_map_of_string":
|
case "map_map_of_string":
|
||||||
mapMapOfString = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref reader, options);
|
mapMapOfString = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_of_enum_string":
|
case "map_of_enum_string":
|
||||||
mapOfEnumString = JsonSerializer.Deserialize<Dictionary<string, MapTest.InnerEnum>>(ref reader, options);
|
mapOfEnumString = JsonSerializer.Deserialize<Dictionary<string, MapTest.InnerEnum>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -239,20 +239,20 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="mapTest"></param>
|
/// <param name="mapTest"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("direct_map");
|
writer.WritePropertyName("direct_map");
|
||||||
JsonSerializer.Serialize(writer, mapTest.DirectMap, options);
|
JsonSerializer.Serialize(writer, mapTest.DirectMap, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("indirect_map");
|
writer.WritePropertyName("indirect_map");
|
||||||
JsonSerializer.Serialize(writer, mapTest.IndirectMap, options);
|
JsonSerializer.Serialize(writer, mapTest.IndirectMap, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_map_of_string");
|
writer.WritePropertyName("map_map_of_string");
|
||||||
JsonSerializer.Serialize(writer, mapTest.MapMapOfString, options);
|
JsonSerializer.Serialize(writer, mapTest.MapMapOfString, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_of_enum_string");
|
writer.WritePropertyName("map_of_enum_string");
|
||||||
JsonSerializer.Serialize(writer, mapTest.MapOfEnumString, options);
|
JsonSerializer.Serialize(writer, mapTest.MapOfEnumString, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -117,47 +117,47 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override MixedPropertiesAndAdditionalPropertiesClass Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override MixedPropertiesAndAdditionalPropertiesClass Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
DateTime dateTime = default;
|
DateTime dateTime = default;
|
||||||
Dictionary<string, Animal> map = default;
|
Dictionary<string, Animal> map = default;
|
||||||
Guid uuid = default;
|
Guid uuid = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "dateTime":
|
case "dateTime":
|
||||||
dateTime = JsonSerializer.Deserialize<DateTime>(ref reader, options);
|
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map":
|
case "map":
|
||||||
map = JsonSerializer.Deserialize<Dictionary<string, Animal>>(ref reader, options);
|
map = JsonSerializer.Deserialize<Dictionary<string, Animal>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "uuid":
|
case "uuid":
|
||||||
uuid = reader.GetGuid();
|
uuid = utf8JsonReader.GetGuid();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -173,16 +173,16 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="mixedPropertiesAndAdditionalPropertiesClass"></param>
|
/// <param name="mixedPropertiesAndAdditionalPropertiesClass"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("dateTime");
|
writer.WritePropertyName("dateTime");
|
||||||
JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.DateTime, options);
|
JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.DateTime, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map");
|
writer.WritePropertyName("map");
|
||||||
JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.Map, options);
|
JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.Map, jsonSerializerOptions);
|
||||||
writer.WriteString("uuid", mixedPropertiesAndAdditionalPropertiesClass.Uuid);
|
writer.WriteString("uuid", mixedPropertiesAndAdditionalPropertiesClass.Uuid);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
|
@ -105,43 +105,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Model200Response Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Model200Response Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string classProperty = default;
|
string classProperty = default;
|
||||||
int name = default;
|
int name = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "class":
|
case "class":
|
||||||
classProperty = reader.GetString();
|
classProperty = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "name":
|
case "name":
|
||||||
name = reader.GetInt32();
|
name = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -157,9 +157,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="model200Response"></param>
|
/// <param name="model200Response"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ModelClient Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ModelClient Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string clientProperty = default;
|
string clientProperty = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "client":
|
case "client":
|
||||||
clientProperty = reader.GetString();
|
clientProperty = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="modelClient"></param>
|
/// <param name="modelClient"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -166,51 +166,51 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Name Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Name Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
int nameProperty = default;
|
int nameProperty = default;
|
||||||
string property = default;
|
string property = default;
|
||||||
int snakeCase = default;
|
int snakeCase = default;
|
||||||
int _123number = default;
|
int _123number = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "name":
|
case "name":
|
||||||
nameProperty = reader.GetInt32();
|
nameProperty = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "property":
|
case "property":
|
||||||
property = reader.GetString();
|
property = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "snake_case":
|
case "snake_case":
|
||||||
snakeCase = reader.GetInt32();
|
snakeCase = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "123Number":
|
case "123Number":
|
||||||
_123number = reader.GetInt32();
|
_123number = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -226,9 +226,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Name name, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -189,19 +189,19 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override NullableClass Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override NullableClass Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
List<Object> arrayItemsNullable = default;
|
List<Object> arrayItemsNullable = default;
|
||||||
Dictionary<string, Object> objectItemsNullable = default;
|
Dictionary<string, Object> objectItemsNullable = default;
|
||||||
@ -216,58 +216,58 @@ namespace Org.OpenAPITools.Model
|
|||||||
Dictionary<string, Object> objectNullableProp = default;
|
Dictionary<string, Object> objectNullableProp = default;
|
||||||
string stringProp = default;
|
string stringProp = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "array_items_nullable":
|
case "array_items_nullable":
|
||||||
arrayItemsNullable = JsonSerializer.Deserialize<List<Object>>(ref reader, options);
|
arrayItemsNullable = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "object_items_nullable":
|
case "object_items_nullable":
|
||||||
objectItemsNullable = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref reader, options);
|
objectItemsNullable = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "array_and_items_nullable_prop":
|
case "array_and_items_nullable_prop":
|
||||||
arrayAndItemsNullableProp = JsonSerializer.Deserialize<List<Object>>(ref reader, options);
|
arrayAndItemsNullableProp = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "array_nullable_prop":
|
case "array_nullable_prop":
|
||||||
arrayNullableProp = JsonSerializer.Deserialize<List<Object>>(ref reader, options);
|
arrayNullableProp = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "boolean_prop":
|
case "boolean_prop":
|
||||||
booleanProp = reader.GetBoolean();
|
booleanProp = utf8JsonReader.GetBoolean();
|
||||||
break;
|
break;
|
||||||
case "date_prop":
|
case "date_prop":
|
||||||
dateProp = JsonSerializer.Deserialize<DateTime?>(ref reader, options);
|
dateProp = JsonSerializer.Deserialize<DateTime?>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "datetime_prop":
|
case "datetime_prop":
|
||||||
datetimeProp = JsonSerializer.Deserialize<DateTime?>(ref reader, options);
|
datetimeProp = JsonSerializer.Deserialize<DateTime?>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "integer_prop":
|
case "integer_prop":
|
||||||
if (reader.TokenType != JsonTokenType.Null)
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
integerProp = reader.GetInt32();
|
integerProp = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "number_prop":
|
case "number_prop":
|
||||||
if (reader.TokenType != JsonTokenType.Null)
|
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||||
numberProp = reader.GetInt32();
|
numberProp = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "object_and_items_nullable_prop":
|
case "object_and_items_nullable_prop":
|
||||||
objectAndItemsNullableProp = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref reader, options);
|
objectAndItemsNullableProp = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "object_nullable_prop":
|
case "object_nullable_prop":
|
||||||
objectNullableProp = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref reader, options);
|
objectNullableProp = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "string_prop":
|
case "string_prop":
|
||||||
stringProp = reader.GetString();
|
stringProp = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -283,28 +283,28 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="nullableClass"></param>
|
/// <param name="nullableClass"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("array_items_nullable");
|
writer.WritePropertyName("array_items_nullable");
|
||||||
JsonSerializer.Serialize(writer, nullableClass.ArrayItemsNullable, options);
|
JsonSerializer.Serialize(writer, nullableClass.ArrayItemsNullable, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("object_items_nullable");
|
writer.WritePropertyName("object_items_nullable");
|
||||||
JsonSerializer.Serialize(writer, nullableClass.ObjectItemsNullable, options);
|
JsonSerializer.Serialize(writer, nullableClass.ObjectItemsNullable, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("array_and_items_nullable_prop");
|
writer.WritePropertyName("array_and_items_nullable_prop");
|
||||||
JsonSerializer.Serialize(writer, nullableClass.ArrayAndItemsNullableProp, options);
|
JsonSerializer.Serialize(writer, nullableClass.ArrayAndItemsNullableProp, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("array_nullable_prop");
|
writer.WritePropertyName("array_nullable_prop");
|
||||||
JsonSerializer.Serialize(writer, nullableClass.ArrayNullableProp, options);
|
JsonSerializer.Serialize(writer, nullableClass.ArrayNullableProp, jsonSerializerOptions);
|
||||||
if (nullableClass.BooleanProp != null)
|
if (nullableClass.BooleanProp != null)
|
||||||
writer.WriteBoolean("boolean_prop", nullableClass.BooleanProp.Value);
|
writer.WriteBoolean("boolean_prop", nullableClass.BooleanProp.Value);
|
||||||
else
|
else
|
||||||
writer.WriteNull("boolean_prop");
|
writer.WriteNull("boolean_prop");
|
||||||
writer.WritePropertyName("date_prop");
|
writer.WritePropertyName("date_prop");
|
||||||
JsonSerializer.Serialize(writer, nullableClass.DateProp, options);
|
JsonSerializer.Serialize(writer, nullableClass.DateProp, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("datetime_prop");
|
writer.WritePropertyName("datetime_prop");
|
||||||
JsonSerializer.Serialize(writer, nullableClass.DatetimeProp, options);
|
JsonSerializer.Serialize(writer, nullableClass.DatetimeProp, jsonSerializerOptions);
|
||||||
if (nullableClass.IntegerProp != null)
|
if (nullableClass.IntegerProp != null)
|
||||||
writer.WriteNumber("integer_prop", nullableClass.IntegerProp.Value);
|
writer.WriteNumber("integer_prop", nullableClass.IntegerProp.Value);
|
||||||
else
|
else
|
||||||
@ -314,9 +314,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
else
|
else
|
||||||
writer.WriteNull("number_prop");
|
writer.WriteNull("number_prop");
|
||||||
writer.WritePropertyName("object_and_items_nullable_prop");
|
writer.WritePropertyName("object_and_items_nullable_prop");
|
||||||
JsonSerializer.Serialize(writer, nullableClass.ObjectAndItemsNullableProp, options);
|
JsonSerializer.Serialize(writer, nullableClass.ObjectAndItemsNullableProp, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("object_nullable_prop");
|
writer.WritePropertyName("object_nullable_prop");
|
||||||
JsonSerializer.Serialize(writer, nullableClass.ObjectNullableProp, options);
|
JsonSerializer.Serialize(writer, nullableClass.ObjectNullableProp, jsonSerializerOptions);
|
||||||
writer.WriteString("string_prop", nullableClass.StringProp);
|
writer.WriteString("string_prop", nullableClass.StringProp);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
|
@ -107,39 +107,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override NullableShape Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override NullableShape Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader triangleReader = reader;
|
Utf8JsonReader triangleReader = utf8JsonReader;
|
||||||
bool triangleDeserialized = Client.ClientUtils.TryDeserialize<Triangle>(ref triangleReader, options, out Triangle? triangle);
|
bool triangleDeserialized = Client.ClientUtils.TryDeserialize<Triangle>(ref triangleReader, jsonSerializerOptions, out Triangle? triangle);
|
||||||
|
|
||||||
Utf8JsonReader quadrilateralReader = reader;
|
Utf8JsonReader quadrilateralReader = utf8JsonReader;
|
||||||
bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize<Quadrilateral>(ref quadrilateralReader, options, out Quadrilateral? quadrilateral);
|
bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize<Quadrilateral>(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral? quadrilateral);
|
||||||
|
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -163,9 +163,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="nullableShape"></param>
|
/// <param name="nullableShape"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override NumberOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override NumberOnly Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
decimal justNumber = default;
|
decimal justNumber = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "JustNumber":
|
case "JustNumber":
|
||||||
justNumber = reader.GetInt32();
|
justNumber = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="numberOnly"></param>
|
/// <param name="numberOnly"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -132,51 +132,51 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ObjectWithDeprecatedFields Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ObjectWithDeprecatedFields Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
List<string> bars = default;
|
List<string> bars = default;
|
||||||
DeprecatedObject deprecatedRef = default;
|
DeprecatedObject deprecatedRef = default;
|
||||||
decimal id = default;
|
decimal id = default;
|
||||||
string uuid = default;
|
string uuid = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "bars":
|
case "bars":
|
||||||
bars = JsonSerializer.Deserialize<List<string>>(ref reader, options);
|
bars = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "deprecatedRef":
|
case "deprecatedRef":
|
||||||
deprecatedRef = JsonSerializer.Deserialize<DeprecatedObject>(ref reader, options);
|
deprecatedRef = JsonSerializer.Deserialize<DeprecatedObject>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "id":
|
case "id":
|
||||||
id = reader.GetInt32();
|
id = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "uuid":
|
case "uuid":
|
||||||
uuid = reader.GetString();
|
uuid = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -192,16 +192,16 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="objectWithDeprecatedFields"></param>
|
/// <param name="objectWithDeprecatedFields"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("bars");
|
writer.WritePropertyName("bars");
|
||||||
JsonSerializer.Serialize(writer, objectWithDeprecatedFields.Bars, options);
|
JsonSerializer.Serialize(writer, objectWithDeprecatedFields.Bars, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("deprecatedRef");
|
writer.WritePropertyName("deprecatedRef");
|
||||||
JsonSerializer.Serialize(writer, objectWithDeprecatedFields.DeprecatedRef, options);
|
JsonSerializer.Serialize(writer, objectWithDeprecatedFields.DeprecatedRef, jsonSerializerOptions);
|
||||||
writer.WriteNumber("id", objectWithDeprecatedFields.Id);
|
writer.WriteNumber("id", objectWithDeprecatedFields.Id);
|
||||||
writer.WriteString("uuid", objectWithDeprecatedFields.Uuid);
|
writer.WriteString("uuid", objectWithDeprecatedFields.Uuid);
|
||||||
|
|
||||||
|
@ -216,19 +216,19 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Order Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Order Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
long id = default;
|
long id = default;
|
||||||
long petId = default;
|
long petId = default;
|
||||||
@ -237,39 +237,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
Order.StatusEnum status = default;
|
Order.StatusEnum status = default;
|
||||||
bool complete = default;
|
bool complete = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "id":
|
case "id":
|
||||||
id = reader.GetInt64();
|
id = utf8JsonReader.GetInt64();
|
||||||
break;
|
break;
|
||||||
case "petId":
|
case "petId":
|
||||||
petId = reader.GetInt64();
|
petId = utf8JsonReader.GetInt64();
|
||||||
break;
|
break;
|
||||||
case "quantity":
|
case "quantity":
|
||||||
quantity = reader.GetInt32();
|
quantity = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "shipDate":
|
case "shipDate":
|
||||||
shipDate = JsonSerializer.Deserialize<DateTime>(ref reader, options);
|
shipDate = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "status":
|
case "status":
|
||||||
string statusRawValue = reader.GetString();
|
string statusRawValue = utf8JsonReader.GetString();
|
||||||
status = Order.StatusEnumFromString(statusRawValue);
|
status = Order.StatusEnumFromString(statusRawValue);
|
||||||
break;
|
break;
|
||||||
case "complete":
|
case "complete":
|
||||||
complete = reader.GetBoolean();
|
complete = utf8JsonReader.GetBoolean();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -285,9 +285,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="order"></param>
|
/// <param name="order"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Order order, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
writer.WriteNumber("petId", order.PetId);
|
writer.WriteNumber("petId", order.PetId);
|
||||||
writer.WriteNumber("quantity", order.Quantity);
|
writer.WriteNumber("quantity", order.Quantity);
|
||||||
writer.WritePropertyName("shipDate");
|
writer.WritePropertyName("shipDate");
|
||||||
JsonSerializer.Serialize(writer, order.ShipDate, options);
|
JsonSerializer.Serialize(writer, order.ShipDate, jsonSerializerOptions);
|
||||||
var statusRawValue = Order.StatusEnumToJsonValue(order.Status);
|
var statusRawValue = Order.StatusEnumToJsonValue(order.Status);
|
||||||
if (statusRawValue != null)
|
if (statusRawValue != null)
|
||||||
writer.WriteString("status", statusRawValue);
|
writer.WriteString("status", statusRawValue);
|
||||||
|
@ -117,47 +117,47 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override OuterComposite Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override OuterComposite Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
bool myBoolean = default;
|
bool myBoolean = default;
|
||||||
decimal myNumber = default;
|
decimal myNumber = default;
|
||||||
string myString = default;
|
string myString = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "my_boolean":
|
case "my_boolean":
|
||||||
myBoolean = reader.GetBoolean();
|
myBoolean = utf8JsonReader.GetBoolean();
|
||||||
break;
|
break;
|
||||||
case "my_number":
|
case "my_number":
|
||||||
myNumber = reader.GetInt32();
|
myNumber = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "my_string":
|
case "my_string":
|
||||||
myString = reader.GetString();
|
myString = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -173,9 +173,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="outerComposite"></param>
|
/// <param name="outerComposite"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -61,39 +61,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ParentPet Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ParentPet Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string petType = default;
|
string petType = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "pet_type":
|
case "pet_type":
|
||||||
petType = reader.GetString();
|
petType = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -109,9 +109,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="parentPet"></param>
|
/// <param name="parentPet"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -216,19 +216,19 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Pet Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Pet Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Category category = default;
|
Category category = default;
|
||||||
long id = default;
|
long id = default;
|
||||||
@ -237,39 +237,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
Pet.StatusEnum status = default;
|
Pet.StatusEnum status = default;
|
||||||
List<Tag> tags = default;
|
List<Tag> tags = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "category":
|
case "category":
|
||||||
category = JsonSerializer.Deserialize<Category>(ref reader, options);
|
category = JsonSerializer.Deserialize<Category>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "id":
|
case "id":
|
||||||
id = reader.GetInt64();
|
id = utf8JsonReader.GetInt64();
|
||||||
break;
|
break;
|
||||||
case "name":
|
case "name":
|
||||||
name = reader.GetString();
|
name = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "photoUrls":
|
case "photoUrls":
|
||||||
photoUrls = JsonSerializer.Deserialize<List<string>>(ref reader, options);
|
photoUrls = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "status":
|
case "status":
|
||||||
string statusRawValue = reader.GetString();
|
string statusRawValue = utf8JsonReader.GetString();
|
||||||
status = Pet.StatusEnumFromString(statusRawValue);
|
status = Pet.StatusEnumFromString(statusRawValue);
|
||||||
break;
|
break;
|
||||||
case "tags":
|
case "tags":
|
||||||
tags = JsonSerializer.Deserialize<List<Tag>>(ref reader, options);
|
tags = JsonSerializer.Deserialize<List<Tag>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -285,25 +285,25 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="pet"></param>
|
/// <param name="pet"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Pet pet, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("category");
|
writer.WritePropertyName("category");
|
||||||
JsonSerializer.Serialize(writer, pet.Category, options);
|
JsonSerializer.Serialize(writer, pet.Category, jsonSerializerOptions);
|
||||||
writer.WriteNumber("id", pet.Id);
|
writer.WriteNumber("id", pet.Id);
|
||||||
writer.WriteString("name", pet.Name);
|
writer.WriteString("name", pet.Name);
|
||||||
writer.WritePropertyName("photoUrls");
|
writer.WritePropertyName("photoUrls");
|
||||||
JsonSerializer.Serialize(writer, pet.PhotoUrls, options);
|
JsonSerializer.Serialize(writer, pet.PhotoUrls, jsonSerializerOptions);
|
||||||
var statusRawValue = Pet.StatusEnumToJsonValue(pet.Status);
|
var statusRawValue = Pet.StatusEnumToJsonValue(pet.Status);
|
||||||
if (statusRawValue != null)
|
if (statusRawValue != null)
|
||||||
writer.WriteString("status", statusRawValue);
|
writer.WriteString("status", statusRawValue);
|
||||||
else
|
else
|
||||||
writer.WriteNull("status");
|
writer.WriteNull("status");
|
||||||
writer.WritePropertyName("tags");
|
writer.WritePropertyName("tags");
|
||||||
JsonSerializer.Serialize(writer, pet.Tags, options);
|
JsonSerializer.Serialize(writer, pet.Tags, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -107,39 +107,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Pig Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Pig Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader basquePigReader = reader;
|
Utf8JsonReader basquePigReader = utf8JsonReader;
|
||||||
bool basquePigDeserialized = Client.ClientUtils.TryDeserialize<BasquePig>(ref basquePigReader, options, out BasquePig? basquePig);
|
bool basquePigDeserialized = Client.ClientUtils.TryDeserialize<BasquePig>(ref basquePigReader, jsonSerializerOptions, out BasquePig? basquePig);
|
||||||
|
|
||||||
Utf8JsonReader danishPigReader = reader;
|
Utf8JsonReader danishPigReader = utf8JsonReader;
|
||||||
bool danishPigDeserialized = Client.ClientUtils.TryDeserialize<DanishPig>(ref danishPigReader, options, out DanishPig? danishPig);
|
bool danishPigDeserialized = Client.ClientUtils.TryDeserialize<DanishPig>(ref danishPigReader, jsonSerializerOptions, out DanishPig? danishPig);
|
||||||
|
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -163,9 +163,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="pig"></param>
|
/// <param name="pig"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -127,45 +127,45 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override PolymorphicProperty Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override PolymorphicProperty Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader _boolReader = reader;
|
Utf8JsonReader _boolReader = utf8JsonReader;
|
||||||
bool _boolDeserialized = Client.ClientUtils.TryDeserialize<bool>(ref _boolReader, options, out bool _bool);
|
bool _boolDeserialized = Client.ClientUtils.TryDeserialize<bool>(ref _boolReader, jsonSerializerOptions, out bool _bool);
|
||||||
|
|
||||||
Utf8JsonReader _stringReader = reader;
|
Utf8JsonReader _stringReader = utf8JsonReader;
|
||||||
bool _stringDeserialized = Client.ClientUtils.TryDeserialize<string>(ref _stringReader, options, out string? _string);
|
bool _stringDeserialized = Client.ClientUtils.TryDeserialize<string>(ref _stringReader, jsonSerializerOptions, out string? _string);
|
||||||
|
|
||||||
Utf8JsonReader _objectReader = reader;
|
Utf8JsonReader _objectReader = utf8JsonReader;
|
||||||
bool _objectDeserialized = Client.ClientUtils.TryDeserialize<Object>(ref _objectReader, options, out Object? _object);
|
bool _objectDeserialized = Client.ClientUtils.TryDeserialize<Object>(ref _objectReader, jsonSerializerOptions, out Object? _object);
|
||||||
|
|
||||||
Utf8JsonReader liststringReader = reader;
|
Utf8JsonReader liststringReader = utf8JsonReader;
|
||||||
bool liststringDeserialized = Client.ClientUtils.TryDeserialize<List<string>>(ref liststringReader, options, out List<string>? liststring);
|
bool liststringDeserialized = Client.ClientUtils.TryDeserialize<List<string>>(ref liststringReader, jsonSerializerOptions, out List<string>? liststring);
|
||||||
|
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -195,9 +195,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="polymorphicProperty"></param>
|
/// <param name="polymorphicProperty"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -107,39 +107,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Quadrilateral Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Quadrilateral Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader simpleQuadrilateralReader = reader;
|
Utf8JsonReader simpleQuadrilateralReader = utf8JsonReader;
|
||||||
bool simpleQuadrilateralDeserialized = Client.ClientUtils.TryDeserialize<SimpleQuadrilateral>(ref simpleQuadrilateralReader, options, out SimpleQuadrilateral? simpleQuadrilateral);
|
bool simpleQuadrilateralDeserialized = Client.ClientUtils.TryDeserialize<SimpleQuadrilateral>(ref simpleQuadrilateralReader, jsonSerializerOptions, out SimpleQuadrilateral? simpleQuadrilateral);
|
||||||
|
|
||||||
Utf8JsonReader complexQuadrilateralReader = reader;
|
Utf8JsonReader complexQuadrilateralReader = utf8JsonReader;
|
||||||
bool complexQuadrilateralDeserialized = Client.ClientUtils.TryDeserialize<ComplexQuadrilateral>(ref complexQuadrilateralReader, options, out ComplexQuadrilateral? complexQuadrilateral);
|
bool complexQuadrilateralDeserialized = Client.ClientUtils.TryDeserialize<ComplexQuadrilateral>(ref complexQuadrilateralReader, jsonSerializerOptions, out ComplexQuadrilateral? complexQuadrilateral);
|
||||||
|
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -163,9 +163,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="quadrilateral"></param>
|
/// <param name="quadrilateral"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override QuadrilateralInterface Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override QuadrilateralInterface Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string quadrilateralType = default;
|
string quadrilateralType = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "quadrilateralType":
|
case "quadrilateralType":
|
||||||
quadrilateralType = reader.GetString();
|
quadrilateralType = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="quadrilateralInterface"></param>
|
/// <param name="quadrilateralInterface"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -141,43 +141,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ReadOnlyFirst Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ReadOnlyFirst Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string bar = default;
|
string bar = default;
|
||||||
string baz = default;
|
string baz = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "bar":
|
case "bar":
|
||||||
bar = reader.GetString();
|
bar = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "baz":
|
case "baz":
|
||||||
baz = reader.GetString();
|
baz = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -193,9 +193,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="readOnlyFirst"></param>
|
/// <param name="readOnlyFirst"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Return Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Return Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
int returnProperty = default;
|
int returnProperty = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "return":
|
case "return":
|
||||||
returnProperty = reader.GetInt32();
|
returnProperty = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="_return"></param>
|
/// <param name="_return"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Return _return, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Return _return, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -89,39 +89,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ScaleneTriangle Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ScaleneTriangle Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader shapeInterfaceReader = reader;
|
Utf8JsonReader shapeInterfaceReader = utf8JsonReader;
|
||||||
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref reader, options, out ShapeInterface? shapeInterface);
|
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref utf8JsonReader, jsonSerializerOptions, out ShapeInterface? shapeInterface);
|
||||||
|
|
||||||
Utf8JsonReader triangleInterfaceReader = reader;
|
Utf8JsonReader triangleInterfaceReader = utf8JsonReader;
|
||||||
bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize<TriangleInterface>(ref reader, options, out TriangleInterface? triangleInterface);
|
bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize<TriangleInterface>(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface? triangleInterface);
|
||||||
|
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -139,9 +139,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="scaleneTriangle"></param>
|
/// <param name="scaleneTriangle"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -136,45 +136,45 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Shape Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Shape Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader triangleReader = reader;
|
Utf8JsonReader triangleReader = utf8JsonReader;
|
||||||
bool triangleDeserialized = Client.ClientUtils.TryDeserialize<Triangle>(ref triangleReader, options, out Triangle? triangle);
|
bool triangleDeserialized = Client.ClientUtils.TryDeserialize<Triangle>(ref triangleReader, jsonSerializerOptions, out Triangle? triangle);
|
||||||
|
|
||||||
Utf8JsonReader quadrilateralReader = reader;
|
Utf8JsonReader quadrilateralReader = utf8JsonReader;
|
||||||
bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize<Quadrilateral>(ref quadrilateralReader, options, out Quadrilateral? quadrilateral);
|
bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize<Quadrilateral>(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral? quadrilateral);
|
||||||
|
|
||||||
string quadrilateralType = default;
|
string quadrilateralType = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "quadrilateralType":
|
case "quadrilateralType":
|
||||||
quadrilateralType = reader.GetString();
|
quadrilateralType = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -196,9 +196,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="shape"></param>
|
/// <param name="shape"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ShapeInterface Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ShapeInterface Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string shapeType = default;
|
string shapeType = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "shapeType":
|
case "shapeType":
|
||||||
shapeType = reader.GetString();
|
shapeType = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="shapeInterface"></param>
|
/// <param name="shapeInterface"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -136,45 +136,45 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ShapeOrNull Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ShapeOrNull Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader triangleReader = reader;
|
Utf8JsonReader triangleReader = utf8JsonReader;
|
||||||
bool triangleDeserialized = Client.ClientUtils.TryDeserialize<Triangle>(ref triangleReader, options, out Triangle? triangle);
|
bool triangleDeserialized = Client.ClientUtils.TryDeserialize<Triangle>(ref triangleReader, jsonSerializerOptions, out Triangle? triangle);
|
||||||
|
|
||||||
Utf8JsonReader quadrilateralReader = reader;
|
Utf8JsonReader quadrilateralReader = utf8JsonReader;
|
||||||
bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize<Quadrilateral>(ref quadrilateralReader, options, out Quadrilateral? quadrilateral);
|
bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize<Quadrilateral>(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral? quadrilateral);
|
||||||
|
|
||||||
string quadrilateralType = default;
|
string quadrilateralType = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "quadrilateralType":
|
case "quadrilateralType":
|
||||||
quadrilateralType = reader.GetString();
|
quadrilateralType = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -196,9 +196,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="shapeOrNull"></param>
|
/// <param name="shapeOrNull"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -89,39 +89,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override SimpleQuadrilateral Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override SimpleQuadrilateral Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader shapeInterfaceReader = reader;
|
Utf8JsonReader shapeInterfaceReader = utf8JsonReader;
|
||||||
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref reader, options, out ShapeInterface? shapeInterface);
|
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref utf8JsonReader, jsonSerializerOptions, out ShapeInterface? shapeInterface);
|
||||||
|
|
||||||
Utf8JsonReader quadrilateralInterfaceReader = reader;
|
Utf8JsonReader quadrilateralInterfaceReader = utf8JsonReader;
|
||||||
bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize<QuadrilateralInterface>(ref reader, options, out QuadrilateralInterface? quadrilateralInterface);
|
bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize<QuadrilateralInterface>(ref utf8JsonReader, jsonSerializerOptions, out QuadrilateralInterface? quadrilateralInterface);
|
||||||
|
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -139,9 +139,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="simpleQuadrilateral"></param>
|
/// <param name="simpleQuadrilateral"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -105,43 +105,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override SpecialModelName Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override SpecialModelName Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string specialModelNameProperty = default;
|
string specialModelNameProperty = default;
|
||||||
long specialPropertyName = default;
|
long specialPropertyName = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "_special_model.name_":
|
case "_special_model.name_":
|
||||||
specialModelNameProperty = reader.GetString();
|
specialModelNameProperty = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "$special[property.name]":
|
case "$special[property.name]":
|
||||||
specialPropertyName = reader.GetInt64();
|
specialPropertyName = utf8JsonReader.GetInt64();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -157,9 +157,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="specialModelName"></param>
|
/// <param name="specialModelName"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -105,43 +105,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Tag Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Tag Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
long id = default;
|
long id = default;
|
||||||
string name = default;
|
string name = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "id":
|
case "id":
|
||||||
id = reader.GetInt64();
|
id = utf8JsonReader.GetInt64();
|
||||||
break;
|
break;
|
||||||
case "name":
|
case "name":
|
||||||
name = reader.GetString();
|
name = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -157,9 +157,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="tag"></param>
|
/// <param name="tag"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Tag tag, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -184,52 +184,52 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Triangle Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Triangle Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader equilateralTriangleReader = reader;
|
Utf8JsonReader equilateralTriangleReader = utf8JsonReader;
|
||||||
bool equilateralTriangleDeserialized = Client.ClientUtils.TryDeserialize<EquilateralTriangle>(ref equilateralTriangleReader, options, out EquilateralTriangle? equilateralTriangle);
|
bool equilateralTriangleDeserialized = Client.ClientUtils.TryDeserialize<EquilateralTriangle>(ref equilateralTriangleReader, jsonSerializerOptions, out EquilateralTriangle? equilateralTriangle);
|
||||||
|
|
||||||
Utf8JsonReader isoscelesTriangleReader = reader;
|
Utf8JsonReader isoscelesTriangleReader = utf8JsonReader;
|
||||||
bool isoscelesTriangleDeserialized = Client.ClientUtils.TryDeserialize<IsoscelesTriangle>(ref isoscelesTriangleReader, options, out IsoscelesTriangle? isoscelesTriangle);
|
bool isoscelesTriangleDeserialized = Client.ClientUtils.TryDeserialize<IsoscelesTriangle>(ref isoscelesTriangleReader, jsonSerializerOptions, out IsoscelesTriangle? isoscelesTriangle);
|
||||||
|
|
||||||
Utf8JsonReader scaleneTriangleReader = reader;
|
Utf8JsonReader scaleneTriangleReader = utf8JsonReader;
|
||||||
bool scaleneTriangleDeserialized = Client.ClientUtils.TryDeserialize<ScaleneTriangle>(ref scaleneTriangleReader, options, out ScaleneTriangle? scaleneTriangle);
|
bool scaleneTriangleDeserialized = Client.ClientUtils.TryDeserialize<ScaleneTriangle>(ref scaleneTriangleReader, jsonSerializerOptions, out ScaleneTriangle? scaleneTriangle);
|
||||||
|
|
||||||
string shapeType = default;
|
string shapeType = default;
|
||||||
string triangleType = default;
|
string triangleType = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "shapeType":
|
case "shapeType":
|
||||||
shapeType = reader.GetString();
|
shapeType = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "triangleType":
|
case "triangleType":
|
||||||
triangleType = reader.GetString();
|
triangleType = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -254,9 +254,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="triangle"></param>
|
/// <param name="triangle"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -93,39 +93,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override TriangleInterface Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override TriangleInterface Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string triangleType = default;
|
string triangleType = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "triangleType":
|
case "triangleType":
|
||||||
triangleType = reader.GetString();
|
triangleType = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="triangleInterface"></param>
|
/// <param name="triangleInterface"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -221,19 +221,19 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override User Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override User Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string email = default;
|
string email = default;
|
||||||
string firstName = default;
|
string firstName = default;
|
||||||
@ -248,56 +248,56 @@ namespace Org.OpenAPITools.Model
|
|||||||
Object anyTypePropNullable = default;
|
Object anyTypePropNullable = default;
|
||||||
Object objectWithNoDeclaredPropsNullable = default;
|
Object objectWithNoDeclaredPropsNullable = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "email":
|
case "email":
|
||||||
email = reader.GetString();
|
email = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "firstName":
|
case "firstName":
|
||||||
firstName = reader.GetString();
|
firstName = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "id":
|
case "id":
|
||||||
id = reader.GetInt64();
|
id = utf8JsonReader.GetInt64();
|
||||||
break;
|
break;
|
||||||
case "lastName":
|
case "lastName":
|
||||||
lastName = reader.GetString();
|
lastName = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "objectWithNoDeclaredProps":
|
case "objectWithNoDeclaredProps":
|
||||||
objectWithNoDeclaredProps = JsonSerializer.Deserialize<Object>(ref reader, options);
|
objectWithNoDeclaredProps = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "password":
|
case "password":
|
||||||
password = reader.GetString();
|
password = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "phone":
|
case "phone":
|
||||||
phone = reader.GetString();
|
phone = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "userStatus":
|
case "userStatus":
|
||||||
userStatus = reader.GetInt32();
|
userStatus = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "username":
|
case "username":
|
||||||
username = reader.GetString();
|
username = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "anyTypeProp":
|
case "anyTypeProp":
|
||||||
anyTypeProp = JsonSerializer.Deserialize<Object>(ref reader, options);
|
anyTypeProp = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "anyTypePropNullable":
|
case "anyTypePropNullable":
|
||||||
anyTypePropNullable = JsonSerializer.Deserialize<Object>(ref reader, options);
|
anyTypePropNullable = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "objectWithNoDeclaredPropsNullable":
|
case "objectWithNoDeclaredPropsNullable":
|
||||||
objectWithNoDeclaredPropsNullable = JsonSerializer.Deserialize<Object>(ref reader, options);
|
objectWithNoDeclaredPropsNullable = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -313,9 +313,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="user"></param>
|
/// <param name="user"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, User user, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
@ -324,17 +324,17 @@ namespace Org.OpenAPITools.Model
|
|||||||
writer.WriteNumber("id", user.Id);
|
writer.WriteNumber("id", user.Id);
|
||||||
writer.WriteString("lastName", user.LastName);
|
writer.WriteString("lastName", user.LastName);
|
||||||
writer.WritePropertyName("objectWithNoDeclaredProps");
|
writer.WritePropertyName("objectWithNoDeclaredProps");
|
||||||
JsonSerializer.Serialize(writer, user.ObjectWithNoDeclaredProps, options);
|
JsonSerializer.Serialize(writer, user.ObjectWithNoDeclaredProps, jsonSerializerOptions);
|
||||||
writer.WriteString("password", user.Password);
|
writer.WriteString("password", user.Password);
|
||||||
writer.WriteString("phone", user.Phone);
|
writer.WriteString("phone", user.Phone);
|
||||||
writer.WriteNumber("userStatus", user.UserStatus);
|
writer.WriteNumber("userStatus", user.UserStatus);
|
||||||
writer.WriteString("username", user.Username);
|
writer.WriteString("username", user.Username);
|
||||||
writer.WritePropertyName("anyTypeProp");
|
writer.WritePropertyName("anyTypeProp");
|
||||||
JsonSerializer.Serialize(writer, user.AnyTypeProp, options);
|
JsonSerializer.Serialize(writer, user.AnyTypeProp, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("anyTypePropNullable");
|
writer.WritePropertyName("anyTypePropNullable");
|
||||||
JsonSerializer.Serialize(writer, user.AnyTypePropNullable, options);
|
JsonSerializer.Serialize(writer, user.AnyTypePropNullable, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("objectWithNoDeclaredPropsNullable");
|
writer.WritePropertyName("objectWithNoDeclaredPropsNullable");
|
||||||
JsonSerializer.Serialize(writer, user.ObjectWithNoDeclaredPropsNullable, options);
|
JsonSerializer.Serialize(writer, user.ObjectWithNoDeclaredPropsNullable, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -117,47 +117,47 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Whale Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Whale Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string className = default;
|
string className = default;
|
||||||
bool hasBaleen = default;
|
bool hasBaleen = default;
|
||||||
bool hasTeeth = default;
|
bool hasTeeth = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "className":
|
case "className":
|
||||||
className = reader.GetString();
|
className = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "hasBaleen":
|
case "hasBaleen":
|
||||||
hasBaleen = reader.GetBoolean();
|
hasBaleen = utf8JsonReader.GetBoolean();
|
||||||
break;
|
break;
|
||||||
case "hasTeeth":
|
case "hasTeeth":
|
||||||
hasTeeth = reader.GetBoolean();
|
hasTeeth = utf8JsonReader.GetBoolean();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -173,9 +173,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="whale"></param>
|
/// <param name="whale"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Whale whale, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -167,43 +167,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Zebra Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Zebra Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string className = default;
|
string className = default;
|
||||||
Zebra.TypeEnum type = default;
|
Zebra.TypeEnum type = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string? propertyName = reader.GetString();
|
string? propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "className":
|
case "className":
|
||||||
className = reader.GetString();
|
className = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "type":
|
case "type":
|
||||||
string typeRawValue = reader.GetString();
|
string typeRawValue = utf8JsonReader.GetString();
|
||||||
type = Zebra.TypeEnumFromString(typeRawValue);
|
type = Zebra.TypeEnumFromString(typeRawValue);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -220,9 +220,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="zebra"></param>
|
/// <param name="zebra"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -91,39 +91,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Activity Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Activity Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Dictionary<string, List<ActivityOutputElementRepresentation>> activityOutputs = default;
|
Dictionary<string, List<ActivityOutputElementRepresentation>> activityOutputs = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "activity_outputs":
|
case "activity_outputs":
|
||||||
activityOutputs = JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref reader, options);
|
activityOutputs = JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -139,14 +139,14 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="activity"></param>
|
/// <param name="activity"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("activity_outputs");
|
writer.WritePropertyName("activity_outputs");
|
||||||
JsonSerializer.Serialize(writer, activity.ActivityOutputs, options);
|
JsonSerializer.Serialize(writer, activity.ActivityOutputs, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -103,43 +103,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ActivityOutputElementRepresentation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ActivityOutputElementRepresentation Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string prop1 = default;
|
string prop1 = default;
|
||||||
Object prop2 = default;
|
Object prop2 = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "prop1":
|
case "prop1":
|
||||||
prop1 = reader.GetString();
|
prop1 = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "prop2":
|
case "prop2":
|
||||||
prop2 = JsonSerializer.Deserialize<Object>(ref reader, options);
|
prop2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -155,15 +155,15 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="activityOutputElementRepresentation"></param>
|
/// <param name="activityOutputElementRepresentation"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WriteString("prop1", activityOutputElementRepresentation.Prop1);
|
writer.WriteString("prop1", activityOutputElementRepresentation.Prop1);
|
||||||
writer.WritePropertyName("prop2");
|
writer.WritePropertyName("prop2");
|
||||||
JsonSerializer.Serialize(writer, activityOutputElementRepresentation.Prop2, options);
|
JsonSerializer.Serialize(writer, activityOutputElementRepresentation.Prop2, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -173,19 +173,19 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override AdditionalPropertiesClass Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override AdditionalPropertiesClass Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Object emptyMap = default;
|
Object emptyMap = default;
|
||||||
Dictionary<string, Dictionary<string, string>> mapOfMapProperty = default;
|
Dictionary<string, Dictionary<string, string>> mapOfMapProperty = default;
|
||||||
@ -196,44 +196,44 @@ namespace Org.OpenAPITools.Model
|
|||||||
Dictionary<string, string> mapWithUndeclaredPropertiesString = default;
|
Dictionary<string, string> mapWithUndeclaredPropertiesString = default;
|
||||||
Object anytype1 = default;
|
Object anytype1 = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "empty_map":
|
case "empty_map":
|
||||||
emptyMap = JsonSerializer.Deserialize<Object>(ref reader, options);
|
emptyMap = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_of_map_property":
|
case "map_of_map_property":
|
||||||
mapOfMapProperty = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref reader, options);
|
mapOfMapProperty = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_property":
|
case "map_property":
|
||||||
mapProperty = JsonSerializer.Deserialize<Dictionary<string, string>>(ref reader, options);
|
mapProperty = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_with_undeclared_properties_anytype_1":
|
case "map_with_undeclared_properties_anytype_1":
|
||||||
mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize<Object>(ref reader, options);
|
mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_with_undeclared_properties_anytype_2":
|
case "map_with_undeclared_properties_anytype_2":
|
||||||
mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize<Object>(ref reader, options);
|
mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_with_undeclared_properties_anytype_3":
|
case "map_with_undeclared_properties_anytype_3":
|
||||||
mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref reader, options);
|
mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "map_with_undeclared_properties_string":
|
case "map_with_undeclared_properties_string":
|
||||||
mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize<Dictionary<string, string>>(ref reader, options);
|
mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "anytype_1":
|
case "anytype_1":
|
||||||
anytype1 = JsonSerializer.Deserialize<Object>(ref reader, options);
|
anytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -249,28 +249,28 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="additionalPropertiesClass"></param>
|
/// <param name="additionalPropertiesClass"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("empty_map");
|
writer.WritePropertyName("empty_map");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.EmptyMap, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.EmptyMap, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_of_map_property");
|
writer.WritePropertyName("map_of_map_property");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapOfMapProperty, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapOfMapProperty, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_property");
|
writer.WritePropertyName("map_property");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapProperty, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapProperty, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_with_undeclared_properties_anytype_1");
|
writer.WritePropertyName("map_with_undeclared_properties_anytype_1");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_with_undeclared_properties_anytype_2");
|
writer.WritePropertyName("map_with_undeclared_properties_anytype_2");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_with_undeclared_properties_anytype_3");
|
writer.WritePropertyName("map_with_undeclared_properties_anytype_3");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("map_with_undeclared_properties_string");
|
writer.WritePropertyName("map_with_undeclared_properties_string");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesString, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesString, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("anytype_1");
|
writer.WritePropertyName("anytype_1");
|
||||||
JsonSerializer.Serialize(writer, additionalPropertiesClass.Anytype1, options);
|
JsonSerializer.Serialize(writer, additionalPropertiesClass.Anytype1, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -113,43 +113,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Animal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Animal Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string className = default;
|
string className = default;
|
||||||
string color = default;
|
string color = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "className":
|
case "className":
|
||||||
className = reader.GetString();
|
className = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "color":
|
case "color":
|
||||||
color = reader.GetString();
|
color = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -165,9 +165,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="animal"></param>
|
/// <param name="animal"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -115,47 +115,47 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ApiResponse Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ApiResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
int code = default;
|
int code = default;
|
||||||
string message = default;
|
string message = default;
|
||||||
string type = default;
|
string type = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "code":
|
case "code":
|
||||||
code = reader.GetInt32();
|
code = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "message":
|
case "message":
|
||||||
message = reader.GetString();
|
message = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "type":
|
case "type":
|
||||||
type = reader.GetString();
|
type = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -171,9 +171,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="apiResponse"></param>
|
/// <param name="apiResponse"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -117,43 +117,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Apple Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Apple Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string cultivar = default;
|
string cultivar = default;
|
||||||
string origin = default;
|
string origin = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "cultivar":
|
case "cultivar":
|
||||||
cultivar = reader.GetString();
|
cultivar = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "origin":
|
case "origin":
|
||||||
origin = reader.GetString();
|
origin = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -169,9 +169,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="apple"></param>
|
/// <param name="apple"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -96,43 +96,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override AppleReq Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override AppleReq Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string cultivar = default;
|
string cultivar = default;
|
||||||
bool mealy = default;
|
bool mealy = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "cultivar":
|
case "cultivar":
|
||||||
cultivar = reader.GetString();
|
cultivar = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "mealy":
|
case "mealy":
|
||||||
mealy = reader.GetBoolean();
|
mealy = utf8JsonReader.GetBoolean();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -148,9 +148,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="appleReq"></param>
|
/// <param name="appleReq"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -91,39 +91,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ArrayOfArrayOfNumberOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ArrayOfArrayOfNumberOnly Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
List<List<decimal>> arrayArrayNumber = default;
|
List<List<decimal>> arrayArrayNumber = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "ArrayArrayNumber":
|
case "ArrayArrayNumber":
|
||||||
arrayArrayNumber = JsonSerializer.Deserialize<List<List<decimal>>>(ref reader, options);
|
arrayArrayNumber = JsonSerializer.Deserialize<List<List<decimal>>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -139,14 +139,14 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="arrayOfArrayOfNumberOnly"></param>
|
/// <param name="arrayOfArrayOfNumberOnly"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("ArrayArrayNumber");
|
writer.WritePropertyName("ArrayArrayNumber");
|
||||||
JsonSerializer.Serialize(writer, arrayOfArrayOfNumberOnly.ArrayArrayNumber, options);
|
JsonSerializer.Serialize(writer, arrayOfArrayOfNumberOnly.ArrayArrayNumber, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -91,39 +91,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ArrayOfNumberOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ArrayOfNumberOnly Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
List<decimal> arrayNumber = default;
|
List<decimal> arrayNumber = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "ArrayNumber":
|
case "ArrayNumber":
|
||||||
arrayNumber = JsonSerializer.Deserialize<List<decimal>>(ref reader, options);
|
arrayNumber = JsonSerializer.Deserialize<List<decimal>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -139,14 +139,14 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="arrayOfNumberOnly"></param>
|
/// <param name="arrayOfNumberOnly"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("ArrayNumber");
|
writer.WritePropertyName("ArrayNumber");
|
||||||
JsonSerializer.Serialize(writer, arrayOfNumberOnly.ArrayNumber, options);
|
JsonSerializer.Serialize(writer, arrayOfNumberOnly.ArrayNumber, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -115,47 +115,47 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ArrayTest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ArrayTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
List<List<long>> arrayArrayOfInteger = default;
|
List<List<long>> arrayArrayOfInteger = default;
|
||||||
List<List<ReadOnlyFirst>> arrayArrayOfModel = default;
|
List<List<ReadOnlyFirst>> arrayArrayOfModel = default;
|
||||||
List<string> arrayOfString = default;
|
List<string> arrayOfString = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "array_array_of_integer":
|
case "array_array_of_integer":
|
||||||
arrayArrayOfInteger = JsonSerializer.Deserialize<List<List<long>>>(ref reader, options);
|
arrayArrayOfInteger = JsonSerializer.Deserialize<List<List<long>>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "array_array_of_model":
|
case "array_array_of_model":
|
||||||
arrayArrayOfModel = JsonSerializer.Deserialize<List<List<ReadOnlyFirst>>>(ref reader, options);
|
arrayArrayOfModel = JsonSerializer.Deserialize<List<List<ReadOnlyFirst>>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
case "array_of_string":
|
case "array_of_string":
|
||||||
arrayOfString = JsonSerializer.Deserialize<List<string>>(ref reader, options);
|
arrayOfString = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -171,18 +171,18 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="arrayTest"></param>
|
/// <param name="arrayTest"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
writer.WritePropertyName("array_array_of_integer");
|
writer.WritePropertyName("array_array_of_integer");
|
||||||
JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfInteger, options);
|
JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfInteger, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("array_array_of_model");
|
writer.WritePropertyName("array_array_of_model");
|
||||||
JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfModel, options);
|
JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfModel, jsonSerializerOptions);
|
||||||
writer.WritePropertyName("array_of_string");
|
writer.WritePropertyName("array_of_string");
|
||||||
JsonSerializer.Serialize(writer, arrayTest.ArrayOfString, options);
|
JsonSerializer.Serialize(writer, arrayTest.ArrayOfString, jsonSerializerOptions);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
@ -91,39 +91,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Banana Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Banana Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
decimal lengthCm = default;
|
decimal lengthCm = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "lengthCm":
|
case "lengthCm":
|
||||||
lengthCm = reader.GetInt32();
|
lengthCm = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -139,9 +139,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="banana"></param>
|
/// <param name="banana"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -96,43 +96,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override BananaReq Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override BananaReq Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
decimal lengthCm = default;
|
decimal lengthCm = default;
|
||||||
bool sweet = default;
|
bool sweet = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "lengthCm":
|
case "lengthCm":
|
||||||
lengthCm = reader.GetInt32();
|
lengthCm = utf8JsonReader.GetInt32();
|
||||||
break;
|
break;
|
||||||
case "sweet":
|
case "sweet":
|
||||||
sweet = reader.GetBoolean();
|
sweet = utf8JsonReader.GetBoolean();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -148,9 +148,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="bananaReq"></param>
|
/// <param name="bananaReq"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -91,39 +91,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override BasquePig Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override BasquePig Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string className = default;
|
string className = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "className":
|
case "className":
|
||||||
className = reader.GetString();
|
className = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -139,9 +139,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="basquePig"></param>
|
/// <param name="basquePig"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -152,19 +152,19 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Capitalization Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string aTTNAME = default;
|
string aTTNAME = default;
|
||||||
string capitalCamel = default;
|
string capitalCamel = default;
|
||||||
@ -173,38 +173,38 @@ namespace Org.OpenAPITools.Model
|
|||||||
string smallCamel = default;
|
string smallCamel = default;
|
||||||
string smallSnake = default;
|
string smallSnake = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "ATT_NAME":
|
case "ATT_NAME":
|
||||||
aTTNAME = reader.GetString();
|
aTTNAME = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "CapitalCamel":
|
case "CapitalCamel":
|
||||||
capitalCamel = reader.GetString();
|
capitalCamel = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "Capital_Snake":
|
case "Capital_Snake":
|
||||||
capitalSnake = reader.GetString();
|
capitalSnake = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "SCA_ETH_Flow_Points":
|
case "SCA_ETH_Flow_Points":
|
||||||
sCAETHFlowPoints = reader.GetString();
|
sCAETHFlowPoints = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "smallCamel":
|
case "smallCamel":
|
||||||
smallCamel = reader.GetString();
|
smallCamel = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "small_Snake":
|
case "small_Snake":
|
||||||
smallSnake = reader.GetString();
|
smallSnake = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -220,9 +220,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="capitalization"></param>
|
/// <param name="capitalization"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -74,49 +74,49 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Cat Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Cat Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader dictionaryReader = reader;
|
Utf8JsonReader dictionaryReader = utf8JsonReader;
|
||||||
bool dictionaryDeserialized = Client.ClientUtils.TryDeserialize<Dictionary<string, int>>(ref reader, options, out Dictionary<string, int> dictionary);
|
bool dictionaryDeserialized = Client.ClientUtils.TryDeserialize<Dictionary<string, int>>(ref utf8JsonReader, jsonSerializerOptions, out Dictionary<string, int> dictionary);
|
||||||
|
|
||||||
Utf8JsonReader catAllOfReader = reader;
|
Utf8JsonReader catAllOfReader = utf8JsonReader;
|
||||||
bool catAllOfDeserialized = Client.ClientUtils.TryDeserialize<CatAllOf>(ref reader, options, out CatAllOf catAllOf);
|
bool catAllOfDeserialized = Client.ClientUtils.TryDeserialize<CatAllOf>(ref utf8JsonReader, jsonSerializerOptions, out CatAllOf catAllOf);
|
||||||
|
|
||||||
string className = default;
|
string className = default;
|
||||||
string color = default;
|
string color = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "className":
|
case "className":
|
||||||
className = reader.GetString();
|
className = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "color":
|
case "color":
|
||||||
color = reader.GetString();
|
color = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -132,9 +132,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="cat"></param>
|
/// <param name="cat"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -91,39 +91,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override CatAllOf Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override CatAllOf Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
bool declawed = default;
|
bool declawed = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "declawed":
|
case "declawed":
|
||||||
declawed = reader.GetBoolean();
|
declawed = utf8JsonReader.GetBoolean();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -139,9 +139,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="catAllOf"></param>
|
/// <param name="catAllOf"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, CatAllOf catAllOf, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, CatAllOf catAllOf, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -103,43 +103,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Category Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Category Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
long id = default;
|
long id = default;
|
||||||
string name = default;
|
string name = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "id":
|
case "id":
|
||||||
id = reader.GetInt64();
|
id = utf8JsonReader.GetInt64();
|
||||||
break;
|
break;
|
||||||
case "name":
|
case "name":
|
||||||
name = reader.GetString();
|
name = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -155,9 +155,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="category"></param>
|
/// <param name="category"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Category category, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -66,42 +66,42 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ChildCat Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ChildCat Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader childCatAllOfReader = reader;
|
Utf8JsonReader childCatAllOfReader = utf8JsonReader;
|
||||||
bool childCatAllOfDeserialized = Client.ClientUtils.TryDeserialize<ChildCatAllOf>(ref reader, options, out ChildCatAllOf childCatAllOf);
|
bool childCatAllOfDeserialized = Client.ClientUtils.TryDeserialize<ChildCatAllOf>(ref utf8JsonReader, jsonSerializerOptions, out ChildCatAllOf childCatAllOf);
|
||||||
|
|
||||||
string petType = default;
|
string petType = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "pet_type":
|
case "pet_type":
|
||||||
petType = reader.GetString();
|
petType = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -117,9 +117,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="childCat"></param>
|
/// <param name="childCat"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -142,43 +142,43 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ChildCatAllOf Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ChildCatAllOf Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string name = default;
|
string name = default;
|
||||||
ChildCatAllOf.PetTypeEnum petType = default;
|
ChildCatAllOf.PetTypeEnum petType = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "name":
|
case "name":
|
||||||
name = reader.GetString();
|
name = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "pet_type":
|
case "pet_type":
|
||||||
string petTypeRawValue = reader.GetString();
|
string petTypeRawValue = utf8JsonReader.GetString();
|
||||||
petType = ChildCatAllOf.PetTypeEnumFromString(petTypeRawValue);
|
petType = ChildCatAllOf.PetTypeEnumFromString(petTypeRawValue);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -195,9 +195,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="childCatAllOf"></param>
|
/// <param name="childCatAllOf"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ChildCatAllOf childCatAllOf, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ChildCatAllOf childCatAllOf, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -91,39 +91,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ClassModel Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ClassModel Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string classProperty = default;
|
string classProperty = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "_class":
|
case "_class":
|
||||||
classProperty = reader.GetString();
|
classProperty = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -139,9 +139,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="classModel"></param>
|
/// <param name="classModel"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -87,39 +87,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override ComplexQuadrilateral Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override ComplexQuadrilateral Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader shapeInterfaceReader = reader;
|
Utf8JsonReader shapeInterfaceReader = utf8JsonReader;
|
||||||
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref reader, options, out ShapeInterface shapeInterface);
|
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref utf8JsonReader, jsonSerializerOptions, out ShapeInterface shapeInterface);
|
||||||
|
|
||||||
Utf8JsonReader quadrilateralInterfaceReader = reader;
|
Utf8JsonReader quadrilateralInterfaceReader = utf8JsonReader;
|
||||||
bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize<QuadrilateralInterface>(ref reader, options, out QuadrilateralInterface quadrilateralInterface);
|
bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize<QuadrilateralInterface>(ref utf8JsonReader, jsonSerializerOptions, out QuadrilateralInterface quadrilateralInterface);
|
||||||
|
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
@ -137,9 +137,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="complexQuadrilateral"></param>
|
/// <param name="complexQuadrilateral"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -91,39 +91,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override DanishPig Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override DanishPig Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string className = default;
|
string className = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "className":
|
case "className":
|
||||||
className = reader.GetString();
|
className = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -139,9 +139,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="danishPig"></param>
|
/// <param name="danishPig"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -91,39 +91,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override DeprecatedObject Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override DeprecatedObject Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string name = default;
|
string name = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "name":
|
case "name":
|
||||||
name = reader.GetString();
|
name = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -139,9 +139,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="deprecatedObject"></param>
|
/// <param name="deprecatedObject"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -67,46 +67,46 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override Dog Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override Dog Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
Utf8JsonReader dogAllOfReader = reader;
|
Utf8JsonReader dogAllOfReader = utf8JsonReader;
|
||||||
bool dogAllOfDeserialized = Client.ClientUtils.TryDeserialize<DogAllOf>(ref reader, options, out DogAllOf dogAllOf);
|
bool dogAllOfDeserialized = Client.ClientUtils.TryDeserialize<DogAllOf>(ref utf8JsonReader, jsonSerializerOptions, out DogAllOf dogAllOf);
|
||||||
|
|
||||||
string className = default;
|
string className = default;
|
||||||
string color = default;
|
string color = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "className":
|
case "className":
|
||||||
className = reader.GetString();
|
className = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
case "color":
|
case "color":
|
||||||
color = reader.GetString();
|
color = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -122,9 +122,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="dog"></param>
|
/// <param name="dog"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
@ -91,39 +91,39 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Json reader.
|
/// A Json reader.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader"></param>
|
/// <param name="utf8JsonReader"></param>
|
||||||
/// <param name="typeToConvert"></param>
|
/// <param name="typeToConvert"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="JsonException"></exception>
|
/// <exception cref="JsonException"></exception>
|
||||||
public override DogAllOf Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override DogAllOf Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
int currentDepth = reader.CurrentDepth;
|
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||||
|
|
||||||
if (reader.TokenType != JsonTokenType.StartObject && reader.TokenType != JsonTokenType.StartArray)
|
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||||
throw new JsonException();
|
throw new JsonException();
|
||||||
|
|
||||||
JsonTokenType startingTokenType = reader.TokenType;
|
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||||
|
|
||||||
string breed = default;
|
string breed = default;
|
||||||
|
|
||||||
while (reader.Read())
|
while (utf8JsonReader.Read())
|
||||||
{
|
{
|
||||||
if (startingTokenType == JsonTokenType.StartObject && reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (startingTokenType == JsonTokenType.StartArray && reader.TokenType == JsonTokenType.EndArray && currentDepth == reader.CurrentDepth)
|
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (reader.TokenType == JsonTokenType.PropertyName && currentDepth == reader.CurrentDepth - 1)
|
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||||
{
|
{
|
||||||
string propertyName = reader.GetString();
|
string propertyName = utf8JsonReader.GetString();
|
||||||
reader.Read();
|
utf8JsonReader.Read();
|
||||||
|
|
||||||
switch (propertyName)
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case "breed":
|
case "breed":
|
||||||
breed = reader.GetString();
|
breed = utf8JsonReader.GetString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -139,9 +139,9 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="writer"></param>
|
/// <param name="writer"></param>
|
||||||
/// <param name="dogAllOf"></param>
|
/// <param name="dogAllOf"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="jsonSerializerOptions"></param>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
public override void Write(Utf8JsonWriter writer, DogAllOf dogAllOf, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, DogAllOf dogAllOf, JsonSerializerOptions jsonSerializerOptions)
|
||||||
{
|
{
|
||||||
writer.WriteStartObject();
|
writer.WriteStartObject();
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user