Skip to content

Commit 9a2a35b

Browse files
committed
Update docs
1 parent f1c15f1 commit 9a2a35b

566 files changed

Lines changed: 1977 additions & 3954 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Adult.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ public override Adult Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert
122122
switch (localVarJsonPropertyName)
123123
{
124124
case "children":
125-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
126-
children = new Option<List<Child>>(JsonSerializer.Deserialize<List<Child>>(ref utf8JsonReader, jsonSerializerOptions));
125+
children = new Option<List<Child>>(JsonSerializer.Deserialize<List<Child>>(ref utf8JsonReader, jsonSerializerOptions));
127126
break;
128127
case "firstName":
129128
firstName = new Option<string>(utf8JsonReader.GetString());

samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert
139139
switch (localVarJsonPropertyName)
140140
{
141141
case "age":
142-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
143-
age = new Option<int?>(utf8JsonReader.GetInt32());
142+
age = new Option<int?>(utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.GetInt32());
144143
break;
145144
case "firstName":
146145
firstName = new Option<string>(utf8JsonReader.GetString());
@@ -152,8 +151,7 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert
152151
type = new Option<string>(utf8JsonReader.GetString());
153152
break;
154153
case "boosterSeat":
155-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
156-
boosterSeat = new Option<bool?>(utf8JsonReader.GetBoolean());
154+
boosterSeat = new Option<bool?>(utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.GetBoolean());
157155
break;
158156
default:
159157
break;

samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Banana.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ public override Banana Read(ref Utf8JsonReader utf8JsonReader, Type typeToConver
126126
switch (localVarJsonPropertyName)
127127
{
128128
case "count":
129-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
130-
count = new Option<decimal?>(utf8JsonReader.GetDecimal());
129+
count = new Option<decimal?>(utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.GetDecimal());
131130
break;
132131
default:
133132
break;

samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ public override Banana Read(ref Utf8JsonReader utf8JsonReader, Type typeToConver
125125
switch (localVarJsonPropertyName)
126126
{
127127
case "count":
128-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
129-
count = new Option<decimal?>(utf8JsonReader.GetDecimal());
128+
count = new Option<decimal?>(utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.GetDecimal());
130129
break;
131130
default:
132131
break;

samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Activity.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ public override Activity Read(ref Utf8JsonReader utf8JsonReader, Type typeToConv
126126
switch (localVarJsonPropertyName)
127127
{
128128
case "activity_outputs":
129-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
130-
activityOutputs = new Option<Dictionary<string, List<ActivityOutputElementRepresentation>>>(JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref utf8JsonReader, jsonSerializerOptions));
129+
activityOutputs = new Option<Dictionary<string, List<ActivityOutputElementRepresentation>>>(JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref utf8JsonReader, jsonSerializerOptions));
131130
break;
132131
default:
133132
break;

samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ public override ActivityOutputElementRepresentation Read(ref Utf8JsonReader utf8
146146
prop1 = new Option<string>(utf8JsonReader.GetString());
147147
break;
148148
case "prop2":
149-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
150-
prop2 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
149+
prop2 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
151150
break;
152151
default:
153152
break;

samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -246,36 +246,28 @@ public override AdditionalPropertiesClass Read(ref Utf8JsonReader utf8JsonReader
246246
switch (localVarJsonPropertyName)
247247
{
248248
case "anytype_1":
249-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
250-
anytype1 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
249+
anytype1 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
251250
break;
252251
case "empty_map":
253-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
254-
emptyMap = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
252+
emptyMap = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
255253
break;
256254
case "map_of_map_property":
257-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
258-
mapOfMapProperty = new Option<Dictionary<string, Dictionary<string, string>>>(JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions));
255+
mapOfMapProperty = new Option<Dictionary<string, Dictionary<string, string>>>(JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions));
259256
break;
260257
case "map_property":
261-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
262-
mapProperty = new Option<Dictionary<string, string>>(JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions));
258+
mapProperty = new Option<Dictionary<string, string>>(JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions));
263259
break;
264260
case "map_with_undeclared_properties_anytype_1":
265-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
266-
mapWithUndeclaredPropertiesAnytype1 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
261+
mapWithUndeclaredPropertiesAnytype1 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
267262
break;
268263
case "map_with_undeclared_properties_anytype_2":
269-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
270-
mapWithUndeclaredPropertiesAnytype2 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
264+
mapWithUndeclaredPropertiesAnytype2 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
271265
break;
272266
case "map_with_undeclared_properties_anytype_3":
273-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
274-
mapWithUndeclaredPropertiesAnytype3 = new Option<Dictionary<string, Object>>(JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions));
267+
mapWithUndeclaredPropertiesAnytype3 = new Option<Dictionary<string, Object>>(JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions));
275268
break;
276269
case "map_with_undeclared_properties_string":
277-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
278-
mapWithUndeclaredPropertiesString = new Option<Dictionary<string, string>>(JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions));
270+
mapWithUndeclaredPropertiesString = new Option<Dictionary<string, string>>(JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions));
279271
break;
280272
default:
281273
break;

samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ public override ApiResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToC
160160
switch (localVarJsonPropertyName)
161161
{
162162
case "code":
163-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
164-
code = new Option<int?>(utf8JsonReader.GetInt32());
163+
code = new Option<int?>(utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.GetInt32());
165164
break;
166165
case "message":
167166
message = new Option<string>(utf8JsonReader.GetString());

samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ public override AppleReq Read(ref Utf8JsonReader utf8JsonReader, Type typeToConv
132132
cultivar = new Option<string>(utf8JsonReader.GetString());
133133
break;
134134
case "mealy":
135-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
136-
mealy = new Option<bool?>(utf8JsonReader.GetBoolean());
135+
mealy = new Option<bool?>(utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.GetBoolean());
137136
break;
138137
default:
139138
break;

samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ public override ArrayOfArrayOfNumberOnly Read(ref Utf8JsonReader utf8JsonReader,
126126
switch (localVarJsonPropertyName)
127127
{
128128
case "ArrayArrayNumber":
129-
if (utf8JsonReader.TokenType != JsonTokenType.Null)
130-
arrayArrayNumber = new Option<List<List<decimal>>>(JsonSerializer.Deserialize<List<List<decimal>>>(ref utf8JsonReader, jsonSerializerOptions));
129+
arrayArrayNumber = new Option<List<List<decimal>>>(JsonSerializer.Deserialize<List<List<decimal>>>(ref utf8JsonReader, jsonSerializerOptions));
131130
break;
132131
default:
133132
break;

0 commit comments

Comments
 (0)