|
185 | 185 | {{/isMap}} |
186 | 186 | {{/isString}} |
187 | 187 | {{#isBoolean}} |
188 | | - if (utf8JsonReader.TokenType != JsonTokenType.Null) |
189 | | - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetBoolean()); |
| 188 | + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.GetBoolean()); |
190 | 189 | {{/isBoolean}} |
191 | 190 | {{#isNumeric}} |
192 | 191 | {{^isEnum}} |
193 | 192 | {{#isDouble}} |
194 | | - if (utf8JsonReader.TokenType != JsonTokenType.Null) |
195 | | - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDouble()); |
| 193 | + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.GetDouble()); |
196 | 194 | {{/isDouble}} |
197 | 195 | {{#isDecimal}} |
198 | | - if (utf8JsonReader.TokenType != JsonTokenType.Null) |
199 | | - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDecimal()); |
| 196 | + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.GetDecimal()); |
200 | 197 | {{/isDecimal}} |
201 | 198 | {{#isFloat}} |
202 | | - if (utf8JsonReader.TokenType != JsonTokenType.Null) |
203 | | - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}(float)utf8JsonReader.GetDouble()); |
| 199 | + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? null : (float)utf8JsonReader.GetDouble()); |
204 | 200 | {{/isFloat}} |
205 | 201 | {{#isLong}} |
206 | | - if (utf8JsonReader.TokenType != JsonTokenType.Null) |
207 | | - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64()); |
| 202 | + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64()); |
208 | 203 | {{/isLong}} |
209 | 204 | {{^isLong}} |
210 | 205 | {{^isFloat}} |
211 | 206 | {{^isDecimal}} |
212 | 207 | {{^isDouble}} |
213 | | - if (utf8JsonReader.TokenType != JsonTokenType.Null) |
214 | | - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); |
| 208 | + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); |
215 | 209 | {{/isDouble}} |
216 | 210 | {{/isDecimal}} |
217 | 211 | {{/isFloat}} |
218 | 212 | {{/isLong}} |
219 | 213 | {{/isEnum}} |
220 | 214 | {{/isNumeric}} |
221 | 215 | {{#isDate}} |
222 | | - if (utf8JsonReader.TokenType != JsonTokenType.Null) |
223 | | - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{#supportsDateOnly}}DateOnly{{/supportsDateOnly}}{{^supportsDateOnly}}DateTime{{/supportsDateOnly}}{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions)); |
| 216 | + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{#supportsDateOnly}}DateOnly{{/supportsDateOnly}}{{^supportsDateOnly}}DateTime{{/supportsDateOnly}}{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions)); |
224 | 217 | {{/isDate}} |
225 | 218 | {{#isDateTime}} |
226 | | - if (utf8JsonReader.TokenType != JsonTokenType.Null) |
227 | | - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<DateTime{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions)); |
| 219 | + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<DateTime{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions)); |
228 | 220 | {{/isDateTime}} |
229 | 221 | {{#isEnum}} |
230 | 222 | {{^isMap}} |
231 | 223 | {{#isNumeric}} |
232 | | - if (utf8JsonReader.TokenType != JsonTokenType.Null) |
233 | | - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}})utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); |
| 224 | + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}})utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); |
234 | 225 | {{/isNumeric}} |
235 | 226 | {{^isNumeric}} |
236 | 227 | string{{nrt?}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = utf8JsonReader.GetString(); |
|
246 | 237 | {{/isMap}} |
247 | 238 | {{/isEnum}} |
248 | 239 | {{#isUuid}} |
249 | | - if (utf8JsonReader.TokenType != JsonTokenType.Null) |
250 | | - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetGuid()); |
| 240 | + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? null : utf8JsonReader.GetGuid()); |
251 | 241 | {{/isUuid}} |
252 | 242 | {{^isUuid}} |
253 | 243 | {{^isEnum}} |
|
256 | 246 | {{^isNumeric}} |
257 | 247 | {{^isDate}} |
258 | 248 | {{^isDateTime}} |
259 | | - if (utf8JsonReader.TokenType != JsonTokenType.Null) |
260 | | - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions){{^isNullable}}{{nrt!}}{{/isNullable}}); |
| 249 | + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions){{^isNullable}}{{nrt!}}{{/isNullable}}); |
261 | 250 | {{/isDateTime}} |
262 | 251 | {{/isDate}} |
263 | 252 | {{/isNumeric}} |
|
0 commit comments