diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index dd21030a4410..27fb0af3b472 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache index 85da5601c027..16ba819b9739 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache @@ -78,14 +78,16 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' + java { {{^useJackson3}} - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 {{/useJackson3}} {{#useJackson3}} - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 {{/useJackson3}} + } publishing { publications { @@ -98,7 +100,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index 8a73de53b7af..59a3ef4d574f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index 70df00024c75..e56d1880a19b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index 692e19cb475e..e5f80094dd6c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache index 420c63ceb1d5..7a364355f431 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache index 5c94b6fe0707..f328c3cce337 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache @@ -21,14 +21,16 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' +java { {{^useJackson3}} -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 {{/useJackson3}} {{#useJackson3}} -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 {{/useJackson3}} +} // Some text from the schema is copy pasted into the source files as UTF-8 // but the default still seems to be to use platform encoding @@ -51,7 +53,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index 34a8460f2277..1b440bd4d3b0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -87,8 +87,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -100,7 +102,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index bcf7118d6e9a..d7d32032b0c0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/build.gradle.mustache index be82ad2e14e8..32f9ba372169 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/build.gradle.mustache @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache index 753ffd3d8eb8..ce34755e8145 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache index 4e53d0bce40c..6e8bf6657364 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache @@ -84,14 +84,16 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' + java { {{#useJakartaEe}} - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 {{/useJakartaEe}} {{^useJakartaEe}} - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 {{/useJakartaEe}} + } publishing { publications { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index 325939ea711f..a8d08435b53e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache index 61760b342e89..250221fa9d50 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache @@ -11,8 +11,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = {{#useVertx5}}JavaVersion.VERSION_11{{/useVertx5}}{{^useVertx5}}JavaVersion.VERSION_1_8{{/useVertx5}} -targetCompatibility = {{#useVertx5}}JavaVersion.VERSION_11{{/useVertx5}}{{^useVertx5}}JavaVersion.VERSION_1_8{{/useVertx5}} +java { + sourceCompatibility = {{#useVertx5}}JavaVersion.VERSION_11{{/useVertx5}}{{^useVertx5}}JavaVersion.VERSION_1_8{{/useVertx5}} + targetCompatibility = {{#useVertx5}}JavaVersion.VERSION_11{{/useVertx5}}{{^useVertx5}}JavaVersion.VERSION_1_8{{/useVertx5}} +} publishing { publications { @@ -24,7 +26,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache index 9789bed53caa..2812d002ced8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache @@ -84,14 +84,16 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' + java { {{#java17}} - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 {{/java17}} {{^java17}} - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 {{/java17}} + } publishing { publications { 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/echo_api/java/apache-httpclient/build.gradle b/samples/client/echo_api/java/apache-httpclient/build.gradle index bd1702805ef8..b529040ea55d 100644 --- a/samples/client/echo_api/java/apache-httpclient/build.gradle +++ b/samples/client/echo_api/java/apache-httpclient/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/echo_api/java/feign-gson/build.gradle b/samples/client/echo_api/java/feign-gson/build.gradle index 988991d69171..7cbe23895efd 100644 --- a/samples/client/echo_api/java/feign-gson/build.gradle +++ b/samples/client/echo_api/java/feign-gson/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/echo_api/java/native/build.gradle b/samples/client/echo_api/java/native/build.gradle index 5aa3e38070c2..b416bc70448e 100644 --- a/samples/client/echo_api/java/native/build.gradle +++ b/samples/client/echo_api/java/native/build.gradle @@ -21,8 +21,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} // Some text from the schema is copy pasted into the source files as UTF-8 // but the default still seems to be to use platform encoding @@ -45,7 +47,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle index dee960e3059b..930bcc11cef9 100644 --- a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/echo_api/java/okhttp-gson/build.gradle b/samples/client/echo_api/java/okhttp-gson/build.gradle index fc5d37bd8ae9..61569dcc78f9 100644 --- a/samples/client/echo_api/java/okhttp-gson/build.gradle +++ b/samples/client/echo_api/java/okhttp-gson/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/echo_api/java/restclient/build.gradle b/samples/client/echo_api/java/restclient/build.gradle index 250a9762f42c..d3fe1aff0fae 100644 --- a/samples/client/echo_api/java/restclient/build.gradle +++ b/samples/client/echo_api/java/restclient/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/echo_api/java/resteasy/build.gradle b/samples/client/echo_api/java/resteasy/build.gradle index b98428358aa0..b3cc7337b382 100644 --- a/samples/client/echo_api/java/resteasy/build.gradle +++ b/samples/client/echo_api/java/resteasy/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/echo_api/java/resttemplate/build.gradle b/samples/client/echo_api/java/resttemplate/build.gradle index 4fe9bd5eff0f..152914ce95a8 100644 --- a/samples/client/echo_api/java/resttemplate/build.gradle +++ b/samples/client/echo_api/java/resttemplate/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/build.gradle b/samples/client/others/java/jersey2-oneOf-Mixed/build.gradle index 6d2c489e78fa..e592db8b045e 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/build.gradle +++ b/samples/client/others/java/jersey2-oneOf-Mixed/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/build.gradle b/samples/client/others/java/jersey2-oneOf-duplicates/build.gradle index 6d2c489e78fa..e592db8b045e 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/build.gradle +++ b/samples/client/others/java/jersey2-oneOf-duplicates/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/others/java/okhttp-gson-oneOf-array/build.gradle b/samples/client/others/java/okhttp-gson-oneOf-array/build.gradle index 68f6c52e5e66..3894157aef97 100644 --- a/samples/client/others/java/okhttp-gson-oneOf-array/build.gradle +++ b/samples/client/others/java/okhttp-gson-oneOf-array/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/others/java/okhttp-gson-oneOf/build.gradle b/samples/client/others/java/okhttp-gson-oneOf/build.gradle index 2b921c867801..092df227eae7 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/build.gradle +++ b/samples/client/others/java/okhttp-gson-oneOf/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/others/java/okhttp-gson-streaming/build.gradle b/samples/client/others/java/okhttp-gson-streaming/build.gradle index 98e539cfc0c1..1252de88dd6e 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.gradle +++ b/samples/client/others/java/okhttp-gson-streaming/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/others/java/restclient-enum-in-multipart/build.gradle b/samples/client/others/java/restclient-enum-in-multipart/build.gradle index 191a1e179261..bf9100bfe4c5 100644 --- a/samples/client/others/java/restclient-enum-in-multipart/build.gradle +++ b/samples/client/others/java/restclient-enum-in-multipart/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/others/java/restclient-sealedInterface/build.gradle b/samples/client/others/java/restclient-sealedInterface/build.gradle index fd9ce11f4338..8052bd66f3d6 100644 --- a/samples/client/others/java/restclient-sealedInterface/build.gradle +++ b/samples/client/others/java/restclient-sealedInterface/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/build.gradle b/samples/client/others/java/restclient-useAbstractionForFiles/build.gradle index 6ba7abbe3a86..310e4d0d5ac2 100644 --- a/samples/client/others/java/restclient-useAbstractionForFiles/build.gradle +++ b/samples/client/others/java/restclient-useAbstractionForFiles/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/others/java/resttemplate-list-schema-validation/build.gradle b/samples/client/others/java/resttemplate-list-schema-validation/build.gradle index abab93014632..ff82bfe6a4a8 100644 --- a/samples/client/others/java/resttemplate-list-schema-validation/build.gradle +++ b/samples/client/others/java/resttemplate-list-schema-validation/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { diff --git a/samples/client/others/java/resttemplate-useAbstractionForFiles/build.gradle b/samples/client/others/java/resttemplate-useAbstractionForFiles/build.gradle index 99ce4d7eb1e8..02b5b7be0049 100644 --- a/samples/client/others/java/resttemplate-useAbstractionForFiles/build.gradle +++ b/samples/client/others/java/resttemplate-useAbstractionForFiles/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { diff --git a/samples/client/others/java/webclient-sealedInterface/build.gradle b/samples/client/others/java/webclient-sealedInterface/build.gradle index 9599d8816609..884481be5dbd 100644 --- a/samples/client/others/java/webclient-sealedInterface/build.gradle +++ b/samples/client/others/java/webclient-sealedInterface/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/others/java/webclient-sealedInterface_3_1/build.gradle b/samples/client/others/java/webclient-sealedInterface_3_1/build.gradle index 9599d8816609..884481be5dbd 100644 --- a/samples/client/others/java/webclient-sealedInterface_3_1/build.gradle +++ b/samples/client/others/java/webclient-sealedInterface_3_1/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/build.gradle b/samples/client/others/java/webclient-useAbstractionForFiles/build.gradle index 2d32e86e7634..3427a2abea88 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/build.gradle +++ b/samples/client/others/java/webclient-useAbstractionForFiles/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { diff --git a/samples/client/petstore/csharp/generichost/latest/AnnotatedEnum/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/latest/AnnotatedEnum/src/Org.OpenAPITools/Api/DefaultApi.cs index 2e9ae368287b..d72ada1a7651 100644 --- a/samples/client/petstore/csharp/generichost/latest/AnnotatedEnum/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/AnnotatedEnum/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -337,12 +337,24 @@ public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index d408281d2470..dd3496dba1dd 100644 --- a/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -344,12 +344,24 @@ public IconsApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public Org.OpenAPITools.Model.IconsDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.IconsDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.IconsDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.IconsDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/NullTypes/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/latest/NullTypes/src/Org.OpenAPITools/Api/DefaultApi.cs index 5aad136fc38b..756a651388c6 100644 --- a/samples/client/petstore/csharp/generichost/latest/NullTypes/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/NullTypes/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -331,12 +331,24 @@ public GetWidgetApiResponse(ILogger logger, System.Net.Http.HttpRequ /// public Org.OpenAPITools.Model.Widget? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Widget? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Widget? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Widget? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeApi.cs index 48dec80ea059..9e80652d445e 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 9df512f32a87..cdd27a5af346 100644 --- a/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -338,12 +338,24 @@ public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.Person? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Person? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Person? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Person? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 4946f189d1b9..490cf1d15f35 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -383,12 +383,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs index 59286835beb1..9482d695776b 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -618,12 +618,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1045,12 +1057,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1268,12 +1292,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1485,12 +1521,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1702,12 +1750,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index b74e8b5e7327..92f1520a06c3 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1468,12 +1468,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1711,12 +1723,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1967,12 +1991,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2210,12 +2246,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2478,12 +2526,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2695,12 +2755,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2912,12 +2984,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3129,12 +3213,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4034,12 +4130,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index fb834c1244ed..01630bf21f65 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -396,12 +396,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/PetApi.cs index c636f7e6a084..9a816da25cec 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/PetApi.cs @@ -1427,12 +1427,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1727,12 +1739,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1979,12 +2003,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2768,12 +2804,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3059,12 +3107,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3337,12 +3397,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs index 3cbfda259a8b..0b9d3a9fc440 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs @@ -749,12 +749,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -978,12 +990,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1244,12 +1268,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/UserApi.cs index 097407c2d62a..e9d312d9919e 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/UserApi.cs @@ -1651,12 +1651,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1707,12 +1719,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1992,12 +2016,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs index 3e7893ff2380..9f213d5ab0be 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 4946f189d1b9..490cf1d15f35 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -383,12 +383,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs index 59286835beb1..9482d695776b 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -618,12 +618,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1045,12 +1057,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1268,12 +1292,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1485,12 +1521,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1702,12 +1750,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index 7ba4ebd49ce9..72946afff806 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1468,12 +1468,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1711,12 +1723,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1967,12 +1991,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2210,12 +2246,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2478,12 +2526,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2695,12 +2755,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2912,12 +2984,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3129,12 +3213,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4034,12 +4130,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index fb834c1244ed..01630bf21f65 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -396,12 +396,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/PetApi.cs index 75999a1c5f60..3c7bad87c4df 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -1427,12 +1427,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1727,12 +1739,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1979,12 +2003,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2768,12 +2804,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3059,12 +3107,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3337,12 +3397,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs index 3cbfda259a8b..0b9d3a9fc440 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -749,12 +749,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -978,12 +990,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1244,12 +1268,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/UserApi.cs index 097407c2d62a..e9d312d9919e 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1651,12 +1651,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1707,12 +1719,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1992,12 +2016,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs index 3e7893ff2380..9f213d5ab0be 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs index a38f90d14670..46b38b4f8cf4 100644 --- a/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public NowGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.NowGet200Response? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NowGet200Response? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NowGet200Response? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NowGet200Response? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs index ba5b50b62959..13a663e7f6b0 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -335,12 +335,24 @@ public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.Person Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Person result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Person DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Person result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 2431f5a7a644..39305d026e47 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs index 2431f5a7a644..39305d026e47 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index f356eb3de999..db6f1e71d026 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -382,12 +382,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs index 98a75477bb80..1bc680ab1433 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -617,12 +617,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1043,12 +1055,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1265,12 +1289,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1481,12 +1517,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1745,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index a3be1bd72629..06ff9ad547bf 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1467,12 +1467,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1964,12 +1988,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2206,12 +2242,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2473,12 +2521,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2689,12 +2749,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2905,12 +2977,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3121,12 +3205,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4025,12 +4121,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index f7609df8dc77..c09e058e3164 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -395,12 +395,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/PetApi.cs index d34716747cd1..636a4db3909d 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/PetApi.cs @@ -1425,12 +1425,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1724,12 +1736,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1975,12 +1999,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2763,12 +2799,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3053,12 +3101,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3330,12 +3390,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs index 273ea1dc482e..e97ecc0fba71 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs @@ -747,12 +747,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -975,12 +987,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1240,12 +1264,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/UserApi.cs index cbd4ec94fa8c..c45bb8908cd8 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/UserApi.cs @@ -1641,12 +1641,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1709,24 @@ public bool TryOk(out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1954,12 +1978,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 2431f5a7a644..39305d026e47 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index f356eb3de999..db6f1e71d026 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -382,12 +382,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs index 98a75477bb80..1bc680ab1433 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -617,12 +617,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1043,12 +1055,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1265,12 +1289,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1481,12 +1517,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1745,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index d69c9c09e74f..a35d346f204e 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1467,12 +1467,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1964,12 +1988,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2206,12 +2242,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2473,12 +2521,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2689,12 +2749,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2905,12 +2977,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3121,12 +3205,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4025,12 +4121,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index f7609df8dc77..c09e058e3164 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -395,12 +395,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/PetApi.cs index 20f58ef2726c..480360f8bc6c 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -1425,12 +1425,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1724,12 +1736,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1975,12 +1999,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2763,12 +2799,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3053,12 +3101,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3330,12 +3390,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs index 273ea1dc482e..e97ecc0fba71 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -747,12 +747,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -975,12 +987,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1240,12 +1264,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/UserApi.cs index cbd4ec94fa8c..c45bb8908cd8 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1641,12 +1641,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1709,24 @@ public bool TryOk(out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1954,12 +1978,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs index f3639d16bee4..acfff6cbc68d 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public NowGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.NowGet200Response Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NowGet200Response result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NowGet200Response DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NowGet200Response result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs index ba5b50b62959..13a663e7f6b0 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -335,12 +335,24 @@ public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.Person Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Person result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Person DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Person result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 2431f5a7a644..39305d026e47 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs index 2431f5a7a644..39305d026e47 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index f356eb3de999..db6f1e71d026 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -382,12 +382,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs index 98a75477bb80..1bc680ab1433 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -617,12 +617,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1043,12 +1055,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1265,12 +1289,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1481,12 +1517,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1745,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index a3be1bd72629..06ff9ad547bf 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1467,12 +1467,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1964,12 +1988,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2206,12 +2242,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2473,12 +2521,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2689,12 +2749,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2905,12 +2977,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3121,12 +3205,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4025,12 +4121,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index f7609df8dc77..c09e058e3164 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -395,12 +395,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs index d34716747cd1..636a4db3909d 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs @@ -1425,12 +1425,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1724,12 +1736,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1975,12 +1999,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2763,12 +2799,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3053,12 +3101,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3330,12 +3390,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs index 273ea1dc482e..e97ecc0fba71 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs @@ -747,12 +747,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -975,12 +987,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1240,12 +1264,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs index cbd4ec94fa8c..c45bb8908cd8 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs @@ -1641,12 +1641,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1709,24 @@ public bool TryOk(out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1954,12 +1978,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 2431f5a7a644..39305d026e47 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index f356eb3de999..db6f1e71d026 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -382,12 +382,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs index 98a75477bb80..1bc680ab1433 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -617,12 +617,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1043,12 +1055,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1265,12 +1289,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1481,12 +1517,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1745,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index d69c9c09e74f..a35d346f204e 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1467,12 +1467,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1964,12 +1988,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2206,12 +2242,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2473,12 +2521,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2689,12 +2749,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2905,12 +2977,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3121,12 +3205,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4025,12 +4121,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index f7609df8dc77..c09e058e3164 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -395,12 +395,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs index 20f58ef2726c..480360f8bc6c 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -1425,12 +1425,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1724,12 +1736,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1975,12 +1999,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2763,12 +2799,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3053,12 +3101,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3330,12 +3390,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs index 273ea1dc482e..e97ecc0fba71 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -747,12 +747,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -975,12 +987,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1240,12 +1264,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs index cbd4ec94fa8c..c45bb8908cd8 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1641,12 +1641,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1697,12 +1709,24 @@ public bool TryOk(out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1954,12 +1978,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs index f3639d16bee4..acfff6cbc68d 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -309,12 +309,24 @@ public NowGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.NowGet200Response Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NowGet200Response result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NowGet200Response DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NowGet200Response result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 9df512f32a87..cdd27a5af346 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -338,12 +338,24 @@ public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.Person? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Person? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Person? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Person? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 4946f189d1b9..490cf1d15f35 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -383,12 +383,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs index 59286835beb1..9482d695776b 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -618,12 +618,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1045,12 +1057,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1268,12 +1292,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1485,12 +1521,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1702,12 +1750,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index b74e8b5e7327..92f1520a06c3 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1468,12 +1468,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1711,12 +1723,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1967,12 +1991,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2210,12 +2246,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2478,12 +2526,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2695,12 +2755,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2912,12 +2984,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3129,12 +3213,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4034,12 +4130,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index fb834c1244ed..01630bf21f65 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -396,12 +396,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs index c636f7e6a084..9a816da25cec 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs @@ -1427,12 +1427,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1727,12 +1739,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1979,12 +2003,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2768,12 +2804,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3059,12 +3107,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3337,12 +3397,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs index 3cbfda259a8b..0b9d3a9fc440 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs @@ -749,12 +749,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -978,12 +990,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1244,12 +1268,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs index 097407c2d62a..e9d312d9919e 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs @@ -1651,12 +1651,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1707,12 +1719,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1992,12 +2016,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs index 3e7893ff2380..9f213d5ab0be 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 4946f189d1b9..490cf1d15f35 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -383,12 +383,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs index 59286835beb1..9482d695776b 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -618,12 +618,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1045,12 +1057,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1268,12 +1292,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1485,12 +1521,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1702,12 +1750,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index 7ba4ebd49ce9..72946afff806 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1468,12 +1468,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1711,12 +1723,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1967,12 +1991,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2210,12 +2246,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2478,12 +2526,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2695,12 +2755,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2912,12 +2984,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3129,12 +3213,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4034,12 +4130,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index fb834c1244ed..01630bf21f65 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -396,12 +396,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs index 75999a1c5f60..3c7bad87c4df 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -1427,12 +1427,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1727,12 +1739,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1979,12 +2003,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2768,12 +2804,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3059,12 +3107,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3337,12 +3397,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs index 3cbfda259a8b..0b9d3a9fc440 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -749,12 +749,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -978,12 +990,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1244,12 +1268,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs index 097407c2d62a..e9d312d9919e 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1651,12 +1651,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1707,12 +1719,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1992,12 +2016,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs index 3e7893ff2380..9f213d5ab0be 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs index a38f90d14670..46b38b4f8cf4 100644 --- a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public NowGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.NowGet200Response? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NowGet200Response? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NowGet200Response? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NowGet200Response? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 9df512f32a87..cdd27a5af346 100644 --- a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -338,12 +338,24 @@ public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.Person? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Person? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Person? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Person? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 4946f189d1b9..490cf1d15f35 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -383,12 +383,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs index 59286835beb1..9482d695776b 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -618,12 +618,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1045,12 +1057,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1268,12 +1292,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1485,12 +1521,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1702,12 +1750,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index b74e8b5e7327..92f1520a06c3 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1468,12 +1468,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1711,12 +1723,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1967,12 +1991,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2210,12 +2246,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2478,12 +2526,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2695,12 +2755,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2912,12 +2984,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3129,12 +3213,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4034,12 +4130,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index fb834c1244ed..01630bf21f65 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -396,12 +396,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/PetApi.cs index c636f7e6a084..9a816da25cec 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/PetApi.cs @@ -1427,12 +1427,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1727,12 +1739,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1979,12 +2003,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2768,12 +2804,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3059,12 +3107,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3337,12 +3397,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs index 3cbfda259a8b..0b9d3a9fc440 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs @@ -749,12 +749,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -978,12 +990,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1244,12 +1268,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/UserApi.cs index 097407c2d62a..e9d312d9919e 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Api/UserApi.cs @@ -1651,12 +1651,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1707,12 +1719,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1992,12 +2016,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs index 3e7893ff2380..9f213d5ab0be 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 592c9c5898ef..174d77530261 100644 --- a/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public RootGetApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.Fruit? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Fruit? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Fruit? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Fruit? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 4946f189d1b9..490cf1d15f35 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -383,12 +383,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs index 59286835beb1..9482d695776b 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -618,12 +618,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1045,12 +1057,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1268,12 +1292,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1485,12 +1521,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1702,12 +1750,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index 7ba4ebd49ce9..72946afff806 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1468,12 +1468,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1711,12 +1723,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1967,12 +1991,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2210,12 +2246,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2478,12 +2526,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2695,12 +2755,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2912,12 +2984,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3129,12 +3213,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4034,12 +4130,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index fb834c1244ed..01630bf21f65 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -396,12 +396,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/PetApi.cs index 75999a1c5f60..3c7bad87c4df 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -1427,12 +1427,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1727,12 +1739,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1979,12 +2003,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2768,12 +2804,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3059,12 +3107,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3337,12 +3397,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs index 3cbfda259a8b..0b9d3a9fc440 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -749,12 +749,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -978,12 +990,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1244,12 +1268,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/UserApi.cs index 097407c2d62a..e9d312d9919e 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1651,12 +1651,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1707,12 +1719,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1992,12 +2016,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8c27696f8420..ad935e9cc144 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -385,12 +385,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs index 00f9455abbba..245780ae507b 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -620,12 +620,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1047,12 +1059,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1270,12 +1294,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string? Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string? DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnDefault(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1487,12 +1523,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List>? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List>? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List>? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List>? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1704,12 +1752,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs index 3e7893ff2380..9f213d5ab0be 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1470,12 +1470,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1713,12 +1725,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1969,12 +1993,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2212,12 +2248,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2480,12 +2528,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2697,12 +2757,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2914,12 +2986,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3131,12 +3215,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4036,12 +4132,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 19201e6173a3..4f404c8b54ff 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -398,12 +398,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs index 79331ea4b0ef..4c08ee893e31 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,12 +1429,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1729,12 +1741,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref List? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1981,12 +2005,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2770,12 +2806,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3061,12 +3109,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3339,12 +3399,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs index a91b3566ff25..813c314d8bbf 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/StoreApi.cs @@ -751,12 +751,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Dictionary? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -980,12 +992,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1246,12 +1270,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs index 278b5313c81f..35400ed9ffa9 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Api/UserApi.cs @@ -1653,12 +1653,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1709,12 +1721,24 @@ public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.User? result) /// public Org.OpenAPITools.Model.User? CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User? result = null; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User? DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User? result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1994,12 +2018,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref string? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs index a38f90d14670..46b38b4f8cf4 100644 --- a/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -312,12 +312,24 @@ public NowGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.NowGet200Response? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NowGet200Response? result = null; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NowGet200Response? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : null; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NowGet200Response? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 2f4dcd8f5431..26bf0141dd99 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -381,12 +381,24 @@ public Call123TestSpecialTagsApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs index 478c7af87d11..29d240726fb9 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -616,12 +616,24 @@ public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.FooGetDefaultResponse Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.FooGetDefaultResponse result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private Org.OpenAPITools.Model.FooGetDefaultResponse DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref Org.OpenAPITools.Model.FooGetDefaultResponse result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1042,12 +1054,24 @@ public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestM /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1264,12 +1288,24 @@ public RedirectOrDefaultApiResponse(ILogger logger, System.Net.Http. /// public string Default() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnDefault(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultDefault(); + return result; + } + + private string DefaultDefault() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsDefault ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnDefault(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 0 Default and the deserialized response is not null /// @@ -1480,12 +1516,24 @@ public RolesReportGetApiResponse(ILogger logger, System.Net.Http.Htt /// public List> Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List> result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List> DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List> result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1696,12 +1744,24 @@ public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMe /// public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index 634953c2057b..38f4b25816e0 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1466,12 +1466,24 @@ public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.HealthCheckResult Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.HealthCheckResult result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.HealthCheckResult DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.HealthCheckResult result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1708,12 +1720,24 @@ public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net. /// public bool? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + bool? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private bool? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref bool? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1963,12 +1987,24 @@ public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Ne /// public Org.OpenAPITools.Model.OuterComposite Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.OuterComposite result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.OuterComposite DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.OuterComposite result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2205,12 +2241,24 @@ public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.H /// public decimal? Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + decimal? result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private decimal? DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref decimal? result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2472,12 +2520,24 @@ public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.H /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2688,12 +2748,24 @@ public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2904,12 +2976,24 @@ public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedAnyOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedAnyOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedAnyOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedAnyOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3120,12 +3204,24 @@ public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.MixedOneOf Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.MixedOneOf result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.MixedOneOf DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.MixedOneOf result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -4024,12 +4120,24 @@ public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpR /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 7f5ee645d275..355848375e2a 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -394,12 +394,24 @@ public TestClassnameApiResponse(ILogger logger, System. /// public Org.OpenAPITools.Model.ModelClient Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ModelClient result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ModelClient DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ModelClient result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/PetApi.cs index 186b3f815b10..646819829910 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -1424,12 +1424,24 @@ public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpR /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1723,12 +1735,24 @@ public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpReq /// public List Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + List result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private List DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref List result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1974,12 +1998,24 @@ public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.Pet Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Pet result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Pet DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Pet result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -2762,12 +2798,24 @@ public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3052,12 +3100,24 @@ public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net. /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -3329,12 +3389,24 @@ public UploadFilesApiResponse(ILogger logger, System.Net.Http.HttpReques /// public Org.OpenAPITools.Model.ApiResponse Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.ApiResponse result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.ApiResponse DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.ApiResponse result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs index e57361a572ac..76fd9aafab69 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -746,12 +746,24 @@ public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Dictionary Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Dictionary result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Dictionary DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Dictionary result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -974,12 +986,24 @@ public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1239,12 +1263,24 @@ public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpReque /// public Org.OpenAPITools.Model.Order Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.Order result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.Order DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.Order result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/UserApi.cs index 65a7cfac2b88..bfec30d3c456 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1640,12 +1640,24 @@ public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpReq /// public Org.OpenAPITools.Model.User Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// @@ -1696,12 +1708,24 @@ public bool TryOk(out Org.OpenAPITools.Model.User result) /// public Org.OpenAPITools.Model.User CustomHttpStatusCode599() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + Org.OpenAPITools.Model.User result = default; + OnCustomHttpStatusCode599(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultCustomHttpStatusCode599(); + return result; + } + + private Org.OpenAPITools.Model.User DefaultCustomHttpStatusCode599() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsCustomHttpStatusCode599 ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnCustomHttpStatusCode599(ref bool suppressDefault, ref Org.OpenAPITools.Model.User result); + /// /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null /// @@ -1953,12 +1977,24 @@ public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequest /// public string Ok() { - // This logic may be modified with the AsModel.mustache template + bool suppressDefault = false; + string result = default; + OnOk(ref suppressDefault, ref result); + if (!suppressDefault) + result = DefaultOk(); + return result; + } + + private string DefaultOk() + { + // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return IsOk ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) : default; } + partial void OnOk(ref bool suppressDefault, ref string result); + /// /// Returns true if the response is 200 Ok and the deserialized response is not null /// diff --git a/samples/client/petstore/java/apache-httpclient-jackson3/build.gradle b/samples/client/petstore/java/apache-httpclient-jackson3/build.gradle index 1fb5fb92d491..8810c9002fa6 100644 --- a/samples/client/petstore/java/apache-httpclient-jackson3/build.gradle +++ b/samples/client/petstore/java/apache-httpclient-jackson3/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/apache-httpclient/build.gradle b/samples/client/petstore/java/apache-httpclient/build.gradle index da935314ee78..cb47bb9d943a 100644 --- a/samples/client/petstore/java/apache-httpclient/build.gradle +++ b/samples/client/petstore/java/apache-httpclient/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/feign-hc5/build.gradle b/samples/client/petstore/java/feign-hc5/build.gradle index fe28a18b08f7..776651e0c5f5 100644 --- a/samples/client/petstore/java/feign-hc5/build.gradle +++ b/samples/client/petstore/java/feign-hc5/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/feign-no-nullable/build.gradle b/samples/client/petstore/java/feign-no-nullable/build.gradle index 372ba1bb798a..86f101c1db7d 100644 --- a/samples/client/petstore/java/feign-no-nullable/build.gradle +++ b/samples/client/petstore/java/feign-no-nullable/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index deecb6856073..382a7e1d0bb4 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/google-api-client/build.gradle b/samples/client/petstore/java/google-api-client/build.gradle index 6e0db793cff4..2e62883ad2e7 100644 --- a/samples/client/petstore/java/google-api-client/build.gradle +++ b/samples/client/petstore/java/google-api-client/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle index 4622f23a0d28..114e2db2f08d 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index fa0e4e435305..48b6d018e475 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/jersey3-jackson3/build.gradle b/samples/client/petstore/java/jersey3-jackson3/build.gradle index 82ac7621ddda..cbaad2e513fc 100644 --- a/samples/client/petstore/java/jersey3-jackson3/build.gradle +++ b/samples/client/petstore/java/jersey3-jackson3/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/jersey3-oneOf/build.gradle b/samples/client/petstore/java/jersey3-oneOf/build.gradle index 6f5a2b503604..157fb07be735 100644 --- a/samples/client/petstore/java/jersey3-oneOf/build.gradle +++ b/samples/client/petstore/java/jersey3-oneOf/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/jersey3/build.gradle b/samples/client/petstore/java/jersey3/build.gradle index 77841c0dfac1..f7d3560b28d1 100644 --- a/samples/client/petstore/java/jersey3/build.gradle +++ b/samples/client/petstore/java/jersey3/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/native-async/build.gradle b/samples/client/petstore/java/native-async/build.gradle index f882b0a31154..437c4b5b1e9b 100644 --- a/samples/client/petstore/java/native-async/build.gradle +++ b/samples/client/petstore/java/native-async/build.gradle @@ -21,8 +21,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} // Some text from the schema is copy pasted into the source files as UTF-8 // but the default still seems to be to use platform encoding @@ -45,7 +47,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/native-jackson3-jspecify/build.gradle b/samples/client/petstore/java/native-jackson3-jspecify/build.gradle index 6678f2900f3f..5dc5a0b7673c 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/build.gradle +++ b/samples/client/petstore/java/native-jackson3-jspecify/build.gradle @@ -21,8 +21,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} // Some text from the schema is copy pasted into the source files as UTF-8 // but the default still seems to be to use platform encoding @@ -45,7 +47,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/native-jackson3/build.gradle b/samples/client/petstore/java/native-jackson3/build.gradle index 103f8aa97421..88bb741e14cf 100644 --- a/samples/client/petstore/java/native-jackson3/build.gradle +++ b/samples/client/petstore/java/native-jackson3/build.gradle @@ -21,8 +21,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} // Some text from the schema is copy pasted into the source files as UTF-8 // but the default still seems to be to use platform encoding @@ -45,7 +47,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/native-jakarta/build.gradle b/samples/client/petstore/java/native-jakarta/build.gradle index a620eae0c41c..2fa62ff4aeab 100644 --- a/samples/client/petstore/java/native-jakarta/build.gradle +++ b/samples/client/petstore/java/native-jakarta/build.gradle @@ -21,8 +21,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} // Some text from the schema is copy pasted into the source files as UTF-8 // but the default still seems to be to use platform encoding @@ -45,7 +47,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/native-useGzipFeature/build.gradle b/samples/client/petstore/java/native-useGzipFeature/build.gradle index 1eebe9818514..d6e96533e4d9 100644 --- a/samples/client/petstore/java/native-useGzipFeature/build.gradle +++ b/samples/client/petstore/java/native-useGzipFeature/build.gradle @@ -21,8 +21,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} // Some text from the schema is copy pasted into the source files as UTF-8 // but the default still seems to be to use platform encoding @@ -45,7 +47,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/native/build.gradle b/samples/client/petstore/java/native/build.gradle index dc5eab589292..506ab2fbf7a0 100644 --- a/samples/client/petstore/java/native/build.gradle +++ b/samples/client/petstore/java/native/build.gradle @@ -21,8 +21,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} // Some text from the schema is copy pasted into the source files as UTF-8 // but the default still seems to be to use platform encoding @@ -45,7 +47,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/build.gradle b/samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/build.gradle index 22ec957c5acc..8b73b0ca05f1 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/okhttp-gson-3.1/build.gradle b/samples/client/petstore/java/okhttp-gson-3.1/build.gradle index c00932a30285..aa8462688f20 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-3.1/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle index f40920350bba..4667113f4626 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle index 6069943445a9..5d1dafc364a4 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle b/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle index c539d0e9f381..f3e422ba24c8 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle b/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle index 8e9f0e295c5c..21c5c88ef179 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle index 803224c0bb6d..4b5115be1eef 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle b/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle index e91e4fccab8e..2731aa94f918 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle b/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle index c8cfbe827db2..296370127e67 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/okhttp-gson/build.gradle b/samples/client/petstore/java/okhttp-gson/build.gradle index 8d19eb1c537a..cfeeabda27eb 100644 --- a/samples/client/petstore/java/okhttp-gson/build.gradle +++ b/samples/client/petstore/java/okhttp-gson/build.gradle @@ -83,8 +83,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -96,7 +98,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/rest-assured-jackson/build.gradle b/samples/client/petstore/java/rest-assured-jackson/build.gradle index e521b5fada96..2b288afae5a1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/build.gradle +++ b/samples/client/petstore/java/rest-assured-jackson/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/rest-assured/build.gradle b/samples/client/petstore/java/rest-assured/build.gradle index 543e4a1616a3..81406852c5cb 100644 --- a/samples/client/petstore/java/rest-assured/build.gradle +++ b/samples/client/petstore/java/rest-assured/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/restclient-nullable-arrays/build.gradle b/samples/client/petstore/java/restclient-nullable-arrays/build.gradle index 8717718f6abf..3b15d3fa8640 100644 --- a/samples/client/petstore/java/restclient-nullable-arrays/build.gradle +++ b/samples/client/petstore/java/restclient-nullable-arrays/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson2/build.gradle b/samples/client/petstore/java/restclient-springBoot4-jackson2/build.gradle index 431e83a45c4c..0796327a6d1c 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson2/build.gradle +++ b/samples/client/petstore/java/restclient-springBoot4-jackson2/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/build.gradle b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/build.gradle index 4a13d95a0242..b00e665b1f69 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/build.gradle +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3/build.gradle b/samples/client/petstore/java/restclient-springBoot4-jackson3/build.gradle index 4a13d95a0242..b00e665b1f69 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3/build.gradle +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/restclient-swagger2/build.gradle b/samples/client/petstore/java/restclient-swagger2/build.gradle index 148523f8b61b..151336395ae0 100644 --- a/samples/client/petstore/java/restclient-swagger2/build.gradle +++ b/samples/client/petstore/java/restclient-swagger2/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/build.gradle b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/build.gradle index 9108cf2dcde8..37051a94a1a1 100644 --- a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/build.gradle +++ b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/restclient-useSingleRequestParameter/build.gradle b/samples/client/petstore/java/restclient-useSingleRequestParameter/build.gradle index abd28bde99bc..ff181739d598 100644 --- a/samples/client/petstore/java/restclient-useSingleRequestParameter/build.gradle +++ b/samples/client/petstore/java/restclient-useSingleRequestParameter/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/restclient/build.gradle b/samples/client/petstore/java/restclient/build.gradle index 2d263b213b36..cbe35507537b 100644 --- a/samples/client/petstore/java/restclient/build.gradle +++ b/samples/client/petstore/java/restclient/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/resteasy/build.gradle b/samples/client/petstore/java/resteasy/build.gradle index 6c7be2289b06..68b1c4432149 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/resttemplate-jakarta/build.gradle b/samples/client/petstore/java/resttemplate-jakarta/build.gradle index a8181d9684ae..081af58759f3 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/build.gradle +++ b/samples/client/petstore/java/resttemplate-jakarta/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson2/build.gradle b/samples/client/petstore/java/resttemplate-springBoot4-jackson2/build.gradle index 6a4e5ed9bc06..6f93c296b1a5 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson2/build.gradle +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson2/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/build.gradle b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/build.gradle index fb07d06311db..447c2a81b768 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/build.gradle +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3/build.gradle b/samples/client/petstore/java/resttemplate-springBoot4-jackson3/build.gradle index 27fddf9c1601..53af1137e39e 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3/build.gradle +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/resttemplate-swagger1/build.gradle b/samples/client/petstore/java/resttemplate-swagger1/build.gradle index 5b4e4b52acba..7337ea12739a 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/build.gradle +++ b/samples/client/petstore/java/resttemplate-swagger1/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { diff --git a/samples/client/petstore/java/resttemplate-swagger2/build.gradle b/samples/client/petstore/java/resttemplate-swagger2/build.gradle index 2698dd943906..c9f291c39022 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/build.gradle +++ b/samples/client/petstore/java/resttemplate-swagger2/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index e220597d0646..8a018bddcba3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { diff --git a/samples/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index d8478e1e5cc1..47fc1c4a46e9 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { diff --git a/samples/client/petstore/java/retrofit2-play26/build.gradle b/samples/client/petstore/java/retrofit2-play26/build.gradle index 019b4ea0220d..b058b6524335 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.gradle +++ b/samples/client/petstore/java/retrofit2-play26/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/retrofit2/build.gradle b/samples/client/petstore/java/retrofit2/build.gradle index abb904cb4051..f55348d5a410 100644 --- a/samples/client/petstore/java/retrofit2/build.gradle +++ b/samples/client/petstore/java/retrofit2/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/retrofit2rx2/build.gradle b/samples/client/petstore/java/retrofit2rx2/build.gradle index 1a8df8dbfdd2..e179d9796a55 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.gradle +++ b/samples/client/petstore/java/retrofit2rx2/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/retrofit2rx3/build.gradle b/samples/client/petstore/java/retrofit2rx3/build.gradle index 074acd96462b..c0ea8db2d67f 100644 --- a/samples/client/petstore/java/retrofit2rx3/build.gradle +++ b/samples/client/petstore/java/retrofit2rx3/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -91,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/client/petstore/java/vertx-no-nullable/build.gradle b/samples/client/petstore/java/vertx-no-nullable/build.gradle index 15a4c12331d3..fec775ecbbef 100644 --- a/samples/client/petstore/java/vertx-no-nullable/build.gradle +++ b/samples/client/petstore/java/vertx-no-nullable/build.gradle @@ -11,8 +11,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} publishing { publications { @@ -24,7 +26,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/vertx-supportVertxFuture/build.gradle b/samples/client/petstore/java/vertx-supportVertxFuture/build.gradle index 0774f5c3c220..89adc0ac29d6 100644 --- a/samples/client/petstore/java/vertx-supportVertxFuture/build.gradle +++ b/samples/client/petstore/java/vertx-supportVertxFuture/build.gradle @@ -11,8 +11,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} publishing { publications { @@ -24,7 +26,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index e7f47e627bd2..068c7c08e94c 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -11,8 +11,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} publishing { publications { @@ -24,7 +26,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/vertx5-supportVertxFuture/build.gradle b/samples/client/petstore/java/vertx5-supportVertxFuture/build.gradle index 5374114e8174..350bd6daddf5 100644 --- a/samples/client/petstore/java/vertx5-supportVertxFuture/build.gradle +++ b/samples/client/petstore/java/vertx5-supportVertxFuture/build.gradle @@ -11,8 +11,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} publishing { publications { @@ -24,7 +26,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/vertx5/build.gradle b/samples/client/petstore/java/vertx5/build.gradle index 7500f8b74207..1b7126f52a4a 100644 --- a/samples/client/petstore/java/vertx5/build.gradle +++ b/samples/client/petstore/java/vertx5/build.gradle @@ -11,8 +11,10 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} publishing { publications { @@ -24,7 +26,7 @@ publishing { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } diff --git a/samples/client/petstore/java/webclient-jakarta/build.gradle b/samples/client/petstore/java/webclient-jakarta/build.gradle index 1982990f1dc6..68248f38f288 100644 --- a/samples/client/petstore/java/webclient-jakarta/build.gradle +++ b/samples/client/petstore/java/webclient-jakarta/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/webclient-nullable-arrays/build.gradle b/samples/client/petstore/java/webclient-nullable-arrays/build.gradle index aa1171e932bf..c35d05237cf1 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/build.gradle +++ b/samples/client/petstore/java/webclient-nullable-arrays/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/build.gradle b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/build.gradle index 269880463e64..d3227bef96ce 100644 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/build.gradle +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3/build.gradle b/samples/client/petstore/java/webclient-springBoot4-jackson3/build.gradle index 9a32b8ff6340..fbbf9bdba1f8 100644 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3/build.gradle +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } publishing { publications { diff --git a/samples/client/petstore/java/webclient-swagger2/build.gradle b/samples/client/petstore/java/webclient-swagger2/build.gradle index 29ba295dc81b..73a7da04b304 100644 --- a/samples/client/petstore/java/webclient-swagger2/build.gradle +++ b/samples/client/petstore/java/webclient-swagger2/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/build.gradle b/samples/client/petstore/java/webclient-useSingleRequestParameter/build.gradle index 8fad20a78d8f..3f52d19c2250 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/build.gradle +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { diff --git a/samples/client/petstore/java/webclient/build.gradle b/samples/client/petstore/java/webclient/build.gradle index de2db5214a1f..fbe1f81d563c 100644 --- a/samples/client/petstore/java/webclient/build.gradle +++ b/samples/client/petstore/java/webclient/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle index fe922fb3517b..582d7c102d72 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle index f6bf9b6c87ee..6f6d46a17694 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/build.gradle index 6b3fffd26763..acdaf782b4b0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/build.gradle index 8da12e0893c1..a05297fe7220 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle index df7bd54670f0..d9bde2ec01da 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle @@ -78,8 +78,10 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } publishing { publications { @@ -92,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } }