diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/AsModel.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/AsModel.mustache index 3c3d96a3fe9f..2cc3ef759614 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/AsModel.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/AsModel.mustache @@ -1,4 +1,4 @@ -// This logic may be modified with the AsModel.mustache template +// NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return Is{{vendorExtensions.x-http-status}} ? {{#isBinary}}ContentStream{{/isBinary}}{{^isBinary}}System.Text.Json.JsonSerializer.Deserialize<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}>(RawContent, _jsonSerializerOptions){{/isBinary}} : {{#net60OrLater}}null{{/net60OrLater}}{{^net60OrLater}}default{{/net60OrLater}}; diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache index 3088a17bce8d..9a12abf424bb 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache @@ -896,6 +896,16 @@ namespace {{packageName}}.{{apiPackage}} /// /// public {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{vendorExtensions.x-http-status}}() + { + bool suppressDefault = false; + {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} result = {{#net60OrLater}}null{{/net60OrLater}}{{^net60OrLater}}default{{/net60OrLater}}; + On{{vendorExtensions.x-http-status}}(ref suppressDefault, ref result); + if (!suppressDefault) + result = Default{{vendorExtensions.x-http-status}}(); + return result; + } + + private {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} Default{{vendorExtensions.x-http-status}}() { {{#lambda.trimTrailingWithNewLine}} {{#lambda.indent4}} @@ -904,6 +914,8 @@ namespace {{packageName}}.{{apiPackage}} {{/lambda.trimTrailingWithNewLine}} } + partial void On{{vendorExtensions.x-http-status}}(ref bool suppressDefault, ref {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} result); + /// /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/AnnotatedEnum/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/latest/AnnotatedEnum/src/Org.OpenAPITools/Api/DefaultApi.cs index 2e9ae368287b..d72ada1a7651 100644 --- a/samples/client/petstore/csharp/generichost/latest/AnnotatedEnum/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/AnnotatedEnum/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -337,12 +337,24 @@ public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index d408281d2470..dd3496dba1dd 100644 --- a/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -344,12 +344,24 @@ public IconsApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public Org.OpenAPITools.Model.IconsDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.IconsDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.IconsDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.IconsDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/NullTypes/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/latest/NullTypes/src/Org.OpenAPITools/Api/DefaultApi.cs index 5aad136fc38b..756a651388c6 100644 --- a/samples/client/petstore/csharp/generichost/latest/NullTypes/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/NullTypes/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -331,12 +331,24 @@ public GetWidgetApiResponse(ILogger logger, System.Net.Http.HttpRequ /// public Org.OpenAPITools.Model.Widget? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Widget? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Widget? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Widget? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeApi.cs index 48dec80ea059..9e80652d445e 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 9df512f32a87..cdd27a5af346 100644 --- a/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -338,12 +338,24 @@ public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.Person? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Person? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Person? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Person? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 4946f189d1b9..490cf1d15f35 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -383,12 +383,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs index 59286835beb1..9482d695776b 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -618,12 +618,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1045,12 +1057,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1268,12 +1292,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1485,12 +1521,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1702,12 +1750,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index b74e8b5e7327..92f1520a06c3 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1468,12 +1468,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1711,12 +1723,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1967,12 +1991,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2210,12 +2246,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2478,12 +2526,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2695,12 +2755,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2912,12 +2984,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3129,12 +3213,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4034,12 +4130,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index fb834c1244ed..01630bf21f65 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -396,12 +396,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/PetApi.cs index c636f7e6a084..9a816da25cec 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/PetApi.cs @@ -1427,12 +1427,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1727,12 +1739,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1979,12 +2003,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2768,12 +2804,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3059,12 +3107,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3337,12 +3397,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs index 3cbfda259a8b..0b9d3a9fc440 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs @@ -749,12 +749,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -978,12 +990,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1244,12 +1268,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/UserApi.cs index 097407c2d62a..e9d312d9919e 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/UserApi.cs @@ -1651,12 +1651,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1707,12 +1719,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1992,12 +2016,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs index 3e7893ff2380..9f213d5ab0be 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 4946f189d1b9..490cf1d15f35 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -383,12 +383,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs index 59286835beb1..9482d695776b 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -618,12 +618,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1045,12 +1057,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1268,12 +1292,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1485,12 +1521,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1702,12 +1750,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index 7ba4ebd49ce9..72946afff806 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1468,12 +1468,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1711,12 +1723,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1967,12 +1991,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2210,12 +2246,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2478,12 +2526,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2695,12 +2755,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2912,12 +2984,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3129,12 +3213,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4034,12 +4130,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index fb834c1244ed..01630bf21f65 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -396,12 +396,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/PetApi.cs index 75999a1c5f60..3c7bad87c4df 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -1427,12 +1427,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1727,12 +1739,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1979,12 +2003,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2768,12 +2804,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3059,12 +3107,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3337,12 +3397,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs index 3cbfda259a8b..0b9d3a9fc440 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -749,12 +749,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -978,12 +990,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1244,12 +1268,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/UserApi.cs index 097407c2d62a..e9d312d9919e 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1651,12 +1651,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1707,12 +1719,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1992,12 +2016,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs index 3e7893ff2380..9f213d5ab0be 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs index a38f90d14670..46b38b4f8cf4 100644 --- a/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public NowGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.NowGet200Response? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NowGet200Response? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NowGet200Response? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NowGet200Response? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs index ba5b50b62959..13a663e7f6b0 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -335,12 +335,24 @@ public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.Person Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Person result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Person DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Person result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 2431f5a7a644..39305d026e47 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs index 2431f5a7a644..39305d026e47 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index f356eb3de999..db6f1e71d026 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -382,12 +382,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs index 98a75477bb80..1bc680ab1433 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -617,12 +617,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1043,12 +1055,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1265,12 +1289,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1481,12 +1517,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1745,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index a3be1bd72629..06ff9ad547bf 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1467,12 +1467,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1964,12 +1988,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2206,12 +2242,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2473,12 +2521,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2689,12 +2749,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2905,12 +2977,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3121,12 +3205,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4025,12 +4121,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index f7609df8dc77..c09e058e3164 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -395,12 +395,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/PetApi.cs index d34716747cd1..636a4db3909d 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/PetApi.cs @@ -1425,12 +1425,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1724,12 +1736,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1975,12 +1999,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2763,12 +2799,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3053,12 +3101,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3330,12 +3390,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs index 273ea1dc482e..e97ecc0fba71 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs @@ -747,12 +747,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -975,12 +987,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1240,12 +1264,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/UserApi.cs index cbd4ec94fa8c..c45bb8908cd8 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/UserApi.cs @@ -1641,12 +1641,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1709,24 @@ public bool TryOk(out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1954,12 +1978,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 2431f5a7a644..39305d026e47 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index f356eb3de999..db6f1e71d026 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -382,12 +382,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs index 98a75477bb80..1bc680ab1433 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -617,12 +617,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1043,12 +1055,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1265,12 +1289,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1481,12 +1517,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1745,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index d69c9c09e74f..a35d346f204e 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1467,12 +1467,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1964,12 +1988,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2206,12 +2242,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2473,12 +2521,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2689,12 +2749,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2905,12 +2977,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3121,12 +3205,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4025,12 +4121,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index f7609df8dc77..c09e058e3164 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -395,12 +395,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/PetApi.cs index 20f58ef2726c..480360f8bc6c 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -1425,12 +1425,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1724,12 +1736,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1975,12 +1999,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2763,12 +2799,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3053,12 +3101,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3330,12 +3390,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs index 273ea1dc482e..e97ecc0fba71 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -747,12 +747,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -975,12 +987,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1240,12 +1264,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/UserApi.cs index cbd4ec94fa8c..c45bb8908cd8 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1641,12 +1641,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1709,24 @@ public bool TryOk(out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1954,12 +1978,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs index f3639d16bee4..acfff6cbc68d 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public NowGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.NowGet200Response Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NowGet200Response result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NowGet200Response DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NowGet200Response result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs index ba5b50b62959..13a663e7f6b0 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -335,12 +335,24 @@ public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.Person Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Person result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Person DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Person result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 2431f5a7a644..39305d026e47 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs index 2431f5a7a644..39305d026e47 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index f356eb3de999..db6f1e71d026 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -382,12 +382,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs index 98a75477bb80..1bc680ab1433 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -617,12 +617,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1043,12 +1055,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1265,12 +1289,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1481,12 +1517,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1745,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index a3be1bd72629..06ff9ad547bf 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1467,12 +1467,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1964,12 +1988,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2206,12 +2242,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2473,12 +2521,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2689,12 +2749,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2905,12 +2977,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3121,12 +3205,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4025,12 +4121,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index f7609df8dc77..c09e058e3164 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -395,12 +395,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs index d34716747cd1..636a4db3909d 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs @@ -1425,12 +1425,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1724,12 +1736,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1975,12 +1999,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2763,12 +2799,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3053,12 +3101,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3330,12 +3390,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs index 273ea1dc482e..e97ecc0fba71 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs @@ -747,12 +747,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -975,12 +987,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1240,12 +1264,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs index cbd4ec94fa8c..c45bb8908cd8 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs @@ -1641,12 +1641,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1709,24 @@ public bool TryOk(out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1954,12 +1978,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 2431f5a7a644..39305d026e47 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index f356eb3de999..db6f1e71d026 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -382,12 +382,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs index 98a75477bb80..1bc680ab1433 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -617,12 +617,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1043,12 +1055,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1265,12 +1289,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1481,12 +1517,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1745,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index d69c9c09e74f..a35d346f204e 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1467,12 +1467,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1964,12 +1988,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2206,12 +2242,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2473,12 +2521,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2689,12 +2749,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2905,12 +2977,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3121,12 +3205,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4025,12 +4121,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index f7609df8dc77..c09e058e3164 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -395,12 +395,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs index 20f58ef2726c..480360f8bc6c 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -1425,12 +1425,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1724,12 +1736,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1975,12 +1999,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2763,12 +2799,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3053,12 +3101,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3330,12 +3390,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs index 273ea1dc482e..e97ecc0fba71 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -747,12 +747,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -975,12 +987,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1240,12 +1264,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs index cbd4ec94fa8c..c45bb8908cd8 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1641,12 +1641,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1709,24 @@ public bool TryOk(out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1954,12 +1978,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs index f3639d16bee4..acfff6cbc68d 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public NowGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.NowGet200Response Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NowGet200Response result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NowGet200Response DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NowGet200Response result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 9df512f32a87..cdd27a5af346 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -338,12 +338,24 @@ public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.Person? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Person? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Person? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Person? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 4946f189d1b9..490cf1d15f35 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -383,12 +383,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs index 59286835beb1..9482d695776b 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -618,12 +618,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1045,12 +1057,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1268,12 +1292,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1485,12 +1521,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1702,12 +1750,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index b74e8b5e7327..92f1520a06c3 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1468,12 +1468,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1711,12 +1723,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1967,12 +1991,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2210,12 +2246,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2478,12 +2526,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2695,12 +2755,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2912,12 +2984,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3129,12 +3213,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4034,12 +4130,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index fb834c1244ed..01630bf21f65 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -396,12 +396,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs index c636f7e6a084..9a816da25cec 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs @@ -1427,12 +1427,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1727,12 +1739,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1979,12 +2003,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2768,12 +2804,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3059,12 +3107,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3337,12 +3397,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs index 3cbfda259a8b..0b9d3a9fc440 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs @@ -749,12 +749,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -978,12 +990,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1244,12 +1268,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs index 097407c2d62a..e9d312d9919e 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs @@ -1651,12 +1651,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1707,12 +1719,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1992,12 +2016,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs index 3e7893ff2380..9f213d5ab0be 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 4946f189d1b9..490cf1d15f35 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -383,12 +383,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs index 59286835beb1..9482d695776b 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -618,12 +618,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1045,12 +1057,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1268,12 +1292,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1485,12 +1521,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1702,12 +1750,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index 7ba4ebd49ce9..72946afff806 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1468,12 +1468,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1711,12 +1723,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1967,12 +1991,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2210,12 +2246,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2478,12 +2526,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2695,12 +2755,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2912,12 +2984,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3129,12 +3213,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4034,12 +4130,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index fb834c1244ed..01630bf21f65 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -396,12 +396,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs index 75999a1c5f60..3c7bad87c4df 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -1427,12 +1427,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1727,12 +1739,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1979,12 +2003,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2768,12 +2804,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3059,12 +3107,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3337,12 +3397,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs index 3cbfda259a8b..0b9d3a9fc440 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -749,12 +749,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -978,12 +990,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1244,12 +1268,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs index 097407c2d62a..e9d312d9919e 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1651,12 +1651,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1707,12 +1719,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1992,12 +2016,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs index 3e7893ff2380..9f213d5ab0be 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs index a38f90d14670..46b38b4f8cf4 100644 --- a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public NowGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.NowGet200Response? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NowGet200Response? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NowGet200Response? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NowGet200Response? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 9df512f32a87..cdd27a5af346 100644 --- a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -338,12 +338,24 @@ public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.Person? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Person? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Person? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Person? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 4946f189d1b9..490cf1d15f35 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -383,12 +383,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs index 59286835beb1..9482d695776b 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -618,12 +618,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1045,12 +1057,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1268,12 +1292,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1485,12 +1521,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1702,12 +1750,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index b74e8b5e7327..92f1520a06c3 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1468,12 +1468,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1711,12 +1723,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1967,12 +1991,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2210,12 +2246,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2478,12 +2526,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2695,12 +2755,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2912,12 +2984,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3129,12 +3213,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4034,12 +4130,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index fb834c1244ed..01630bf21f65 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -396,12 +396,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/PetApi.cs index c636f7e6a084..9a816da25cec 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/PetApi.cs @@ -1427,12 +1427,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1727,12 +1739,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1979,12 +2003,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2768,12 +2804,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3059,12 +3107,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3337,12 +3397,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs index 3cbfda259a8b..0b9d3a9fc440 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs @@ -749,12 +749,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -978,12 +990,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1244,12 +1268,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/UserApi.cs index 097407c2d62a..e9d312d9919e 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/UserApi.cs @@ -1651,12 +1651,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1707,12 +1719,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1992,12 +2016,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs index 3e7893ff2380..9f213d5ab0be 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 4946f189d1b9..490cf1d15f35 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -383,12 +383,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs index 59286835beb1..9482d695776b 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -618,12 +618,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1045,12 +1057,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1268,12 +1292,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1485,12 +1521,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1702,12 +1750,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index 7ba4ebd49ce9..72946afff806 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1468,12 +1468,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1711,12 +1723,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1967,12 +1991,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2210,12 +2246,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2478,12 +2526,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2695,12 +2755,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2912,12 +2984,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3129,12 +3213,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4034,12 +4130,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index fb834c1244ed..01630bf21f65 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -396,12 +396,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/PetApi.cs index 75999a1c5f60..3c7bad87c4df 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -1427,12 +1427,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1727,12 +1739,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1979,12 +2003,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2768,12 +2804,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3059,12 +3107,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3337,12 +3397,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs index 3cbfda259a8b..0b9d3a9fc440 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -749,12 +749,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -978,12 +990,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1244,12 +1268,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/UserApi.cs index 097407c2d62a..e9d312d9919e 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1651,12 +1651,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1707,12 +1719,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1992,12 +2016,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs index 3e7893ff2380..9f213d5ab0be 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs index a38f90d14670..46b38b4f8cf4 100644 --- a/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public NowGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.NowGet200Response? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NowGet200Response? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NowGet200Response? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NowGet200Response? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 2f4dcd8f5431..26bf0141dd99 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -381,12 +381,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs index 478c7af87d11..29d240726fb9 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -616,12 +616,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1042,12 +1054,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1264,12 +1288,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1480,12 +1516,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1696,12 +1744,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index 634953c2057b..38f4b25816e0 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1466,12 +1466,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1708,12 +1720,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1963,12 +1987,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2205,12 +2241,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2472,12 +2520,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2688,12 +2748,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2904,12 +2976,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3120,12 +3204,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4024,12 +4120,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 7f5ee645d275..355848375e2a 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -394,12 +394,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/PetApi.cs index 186b3f815b10..646819829910 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -1424,12 +1424,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1723,12 +1735,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1974,12 +1998,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2762,12 +2798,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3052,12 +3100,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3329,12 +3389,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs index e57361a572ac..76fd9aafab69 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -746,12 +746,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -974,12 +986,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1239,12 +1263,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/UserApi.cs index 65a7cfac2b88..bfec30d3c456 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1640,12 +1640,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1696,12 +1708,24 @@ public bool TryOk(out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1953,12 +1977,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null ///