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
///