From 5ee564c5306d8306980c85029ff7f71ed7a19f7d Mon Sep 17 00:00:00 2001 From: Tiffany Marrel Date: Tue, 13 Dec 2022 14:59:01 +0100 Subject: [PATCH 1/5] use HttpBearerAuth only when relevant --- .../src/main/resources/Java/ApiClient.mustache | 4 ++-- .../libraries/apache-httpclient/ApiClient.mustache | 4 ++-- .../Java/libraries/feign/ApiClient.mustache | 4 ++-- .../Java/libraries/okhttp-gson/ApiClient.mustache | 12 ++++++------ .../Java/libraries/resteasy/ApiClient.mustache | 4 ++-- .../Java/libraries/resttemplate/ApiClient.mustache | 4 ++-- .../Java/libraries/retrofit/ApiClient.mustache | 4 ++-- .../Java/libraries/retrofit2/ApiClient.mustache | 4 ++-- .../libraries/retrofit2/play24/ApiClient.mustache | 4 ++-- .../Java/libraries/vertx/ApiClient.mustache | 12 ++++++------ .../Java/libraries/webclient/ApiClient.mustache | 4 ++-- .../jvm-ktor/infrastructure/ApiClient.kt.mustache | 4 ++-- .../infrastructure/ApiClient.kt.mustache | 4 ++-- .../resources/2_0/templates/Java/ApiClient.mustache | 4 ++-- 14 files changed, 36 insertions(+), 36 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache index 6aa42b790639..ed5012fc5cfa 100644 --- a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache @@ -124,8 +124,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache index 2fd8862ba3d6..7a78f616c777 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache @@ -156,8 +156,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache index 74ab1d027569..9c5b28049615 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -100,9 +100,9 @@ public class ApiClient { {{#isBasicBasic}} auth = new HttpBasicAuth(); {{/isBasicBasic}} - {{^isBasicBasic}} + {{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}} + {{/isBasicBearer}} {{/isBasic}} {{#isApiKey}} auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 234b14aeef1a..10121f95da82 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -135,8 +135,8 @@ public class ApiClient { initHttpClient(); // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}{{#withAWSV4Signature}} authentications.put("AWS4Auth", new AWS4Auth());{{/withAWSV4Signature}} @@ -155,8 +155,8 @@ public class ApiClient { httpClient = client; // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}{{#withAWSV4Signature}} authentications.put("AWS4Auth", new AWS4Auth());{{/withAWSV4Signature}} @@ -228,8 +228,8 @@ public class ApiClient { ); initHttpClient(Collections.singletonList(retryingOAuth)); // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{/authMethods}}{{#withAWSV4Signature}} authentications.put("AWS4Auth", new AWS4Auth());{{/withAWSV4Signature}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache index cd86dd44ccf9..45a49cdf8190 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache @@ -85,8 +85,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index a844c8c384fa..98fce3cfc20c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -132,8 +132,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/ApiClient.mustache index 465762a36bab..e0f0a9ad606a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/ApiClient.mustache @@ -65,9 +65,9 @@ public class ApiClient { {{#isBasicBasic}} auth = new HttpBasicAuth(); {{/isBasicBasic}} - {{^isBasicBasic}} + {{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}} + {{/isBasicBearer}} {{/isBasic}} {{#isApiKey}} auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache index 8e40fd194c83..25a1fb8b8719 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache @@ -70,9 +70,9 @@ public class ApiClient { {{#authMethods}}if ("{{name}}".equals(authName)) { {{#isBasic}}{{#isBasicBasic}} auth = new HttpBasicAuth(); - {{/isBasicBasic}}{{^isBasicBasic}} + {{/isBasicBasic}}{{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}}{{/isBasic}} + {{/isBasicBearer}}{{/isBasic}} {{#isApiKey}} auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); {{/isApiKey}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache index c43f800a42c5..e19b3dc6e5da 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache @@ -45,8 +45,8 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - // authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + // authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} // authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache index 68253df0bdea..c745392012f4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache @@ -93,8 +93,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). this.authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -685,14 +685,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { auth.setUsername(username); auth.setPassword(password); authentications.put("{{name}}", auth); - }{{/isBasicBasic}}{{^isBasicBasic}} + }{{/isBasicBasic}}{{#isBasicBearer}} public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String bearerToken) { HttpBearerAuth auth = new HttpBearerAuth("{{scheme}}"); auth.setBearerToken(bearerToken); authentications.put("{{name}}", auth); - }{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + }{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String apikey, String apiKeyPrefix) { ApiKeyAuth auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}},"{{keyParamName}}"); @@ -711,13 +711,13 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { AuthInfo authInfo = new AuthInfo(); authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(username, password); return authInfo; - }{{/isBasicBasic}}{{^isBasicBasic}} + }{{/isBasicBasic}}{{#isBasicBearer}} public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String bearerToken) { AuthInfo authInfo = new AuthInfo(); authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(bearerToken); return authInfo; - }{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + }{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String apikey, String apiKeyPrefix) { AuthInfo authInfo = new AuthInfo(); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache index 964ef635fd6d..b574d3bdb48d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache @@ -155,8 +155,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { protected void init() { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache index 301af9194f8c..de3db091a8fd 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache @@ -70,8 +70,8 @@ import {{packageName}}.auth.* {{#hasAuthMethods}} private val authentications: kotlin.collections.Map by lazy { mapOf({{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - "{{name}}" to HttpBasicAuth(){{/isBasicBasic}}{{^isBasicBasic}} - "{{name}}" to HttpBearerAuth("{{scheme}}"){{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + "{{name}}" to HttpBasicAuth(){{/isBasicBasic}}{{#isBasicBearer}} + "{{name}}" to HttpBearerAuth("{{scheme}}"){{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} "{{name}}" to ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"){{/isApiKey}}{{#isOAuth}} "{{name}}" to OAuth(){{/isOAuth}}{{^-last}}, {{/-last}}{{/authMethods}}) } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache index bbed97d77aed..82cc8a6fe3cd 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache @@ -39,8 +39,8 @@ import {{packageName}}.auth.* {{#hasAuthMethods}} private val authentications: kotlin.collections.Map by lazy { mapOf({{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - "{{name}}" to HttpBasicAuth(){{/isBasicBasic}}{{^isBasicBasic}} - "{{name}}" to HttpBearerAuth("{{scheme}}"){{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + "{{name}}" to HttpBasicAuth(){{/isBasicBasic}}{{#isBasicBearer}} + "{{name}}" to HttpBearerAuth("{{scheme}}"){{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} "{{name}}" to ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"){{/isApiKey}}{{#isOAuth}} "{{name}}" to OAuth(){{/isOAuth}}{{^-last}}, {{/-last}}{{/authMethods}}) } diff --git a/modules/openapi-generator/src/test/resources/2_0/templates/Java/ApiClient.mustache b/modules/openapi-generator/src/test/resources/2_0/templates/Java/ApiClient.mustache index d75e455961c5..b2ff2fba19b8 100644 --- a/modules/openapi-generator/src/test/resources/2_0/templates/Java/ApiClient.mustache +++ b/modules/openapi-generator/src/test/resources/2_0/templates/Java/ApiClient.mustache @@ -144,8 +144,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. From 879adf6b832a0c787c73d83dce2aaf6a73eeca60 Mon Sep 17 00:00:00 2001 From: Tiffany Marrel Date: Tue, 11 Apr 2023 17:26:33 +0200 Subject: [PATCH 2/5] address PR review comment --- .../main/resources/Java/libraries/feign/ApiClient.mustache | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache index 9c5b28049615..6945b2f2bd47 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -100,9 +100,14 @@ public class ApiClient { {{#isBasicBasic}} auth = new HttpBasicAuth(); {{/isBasicBasic}} + {{^isBasicBasic}} {{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); {{/isBasicBearer}} + {{^isBasicBearer}} + throw new RuntimeException("auth name \"" + authName + "\" is not a supported basic auth type"); + {{/isBasicBearer}} + {{/isBasicBasic}} {{/isBasic}} {{#isApiKey}} auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); From bebc68b647a5e3f83f11473031cef4d267570b3c Mon Sep 17 00:00:00 2001 From: Tiffany Marrel Date: Fri, 3 Mar 2023 16:58:53 +0100 Subject: [PATCH 3/5] regenerate samples --- .../src/main/java/org/openapitools/client/ApiClient.java | 1 - .../feign/src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 3 --- .../src/main/java/org/openapitools/client/ApiClient.java | 1 - .../src/main/java/org/openapitools/client/ApiClient.java | 1 - 5 files changed, 1 insertion(+), 7 deletions(-) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java index 81c2b245a5b1..1a938cde9593 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java @@ -179,7 +179,6 @@ public ApiClient(CloseableHttpClient httpClient) { authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); authentications.put("http_basic_test", new HttpBasicAuth()); authentications.put("bearer_test", new HttpBearerAuth("bearer")); - authentications.put("http_signature_test", new HttpBearerAuth("signature")); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java index 69202216e6b9..09b3e06ee8b4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java @@ -70,7 +70,7 @@ public ApiClient(String[] authNames) { } else if ("bearer_test".equals(authName)) { auth = new HttpBearerAuth("bearer"); } else if ("http_signature_test".equals(authName)) { - auth = new HttpBearerAuth("signature"); + throw new RuntimeException("auth name \"" + authName + "\" is not a supported basic auth type"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index cd4e46b4d770..147996f875db 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -152,7 +152,6 @@ public ApiClient() { authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); authentications.put("http_basic_test", new HttpBasicAuth()); authentications.put("bearer_test", new HttpBearerAuth("bearer")); - authentications.put("http_signature_test", new HttpBearerAuth("signature")); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -173,7 +172,6 @@ public ApiClient(OkHttpClient client) { authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); authentications.put("http_basic_test", new HttpBasicAuth()); authentications.put("bearer_test", new HttpBearerAuth("bearer")); - authentications.put("http_signature_test", new HttpBearerAuth("signature")); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -243,7 +241,6 @@ public ApiClient(String basePath, String clientId, String clientSecret, Map Date: Thu, 13 Apr 2023 09:40:01 +0200 Subject: [PATCH 4/5] remove unsupported signature security scheme from generation of samples the signature scheme was added by #6058 for jersey2-experimental (now jersey2-java8) only but this change affected all samples; and it was not removed when there is another special yaml file with http-signature-test (#4993) was introduced --- bin/configs/java-okhttp-gson.yaml | 2 +- ...oints-models-for-testing-okhttp-gson.yaml} | 10 - ...ith-fake-endpoints-models-for-testing.yaml | 29 -- ...ith-fake-endpoints-models-for-testing.yaml | 29 -- ...ith-fake-endpoints-models-for-testing.yaml | 54 +--- .../petstore/csharp/OpenAPIClient/README.md | 5 - .../csharp/OpenAPIClient/docs/FakeApi.md | 79 ------ .../src/Org.OpenAPITools/Api/FakeApi.cs | 215 --------------- .../elixir/lib/openapi_petstore/api/fake.ex | 38 --- .../java-helidon-client/mp/docs/FakeApi.md | 36 --- .../org/openapitools/client/api/FakeApi.java | 9 - .../java-helidon-client/se/docs/FakeApi.md | 70 ----- .../org/openapitools/client/api/FakeApi.java | 10 - .../openapitools/client/api/FakeApiImpl.java | 53 ---- .../petstore/java/apache-httpclient/README.md | 6 - .../java/apache-httpclient/api/openapi.yaml | 35 --- .../java/apache-httpclient/docs/FakeApi.md | 70 ----- .../org/openapitools/client/api/FakeApi.java | 79 ------ .../petstore/java/feign/api/openapi.yaml | 35 --- .../org/openapitools/client/ApiClient.java | 2 - .../org/openapitools/client/api/FakeApi.java | 90 ------ .../petstore/java/webclient-jakarta/README.md | 6 - .../java/webclient-jakarta/api/openapi.yaml | 35 --- .../java/webclient-jakarta/docs/FakeApi.md | 70 ----- .../org/openapitools/client/api/FakeApi.java | 82 ------ .../client/petstore/java/webclient/README.md | 6 - .../petstore/java/webclient/api/openapi.yaml | 35 --- .../petstore/java/webclient/docs/FakeApi.md | 70 ----- .../org/openapitools/client/api/FakeApi.java | 82 ------ samples/client/petstore/k6/script.js | 18 -- samples/client/petstore/perl/README.md | 5 - samples/client/petstore/perl/docs/FakeApi.md | 51 ---- .../perl/lib/WWW/OpenAPIClient/ApiClient.pm | 2 - .../perl/lib/WWW/OpenAPIClient/FakeApi.pm | 83 ------ .../petstore/php/OpenAPIClient-php/README.md | 4 - .../php/OpenAPIClient-php/docs/Api/FakeApi.md | 60 ---- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 257 ------------------ .../client/petstore/ruby-autoload/README.md | 4 - .../petstore/ruby-autoload/docs/FakeApi.md | 71 ----- .../lib/petstore/api/fake_api.rb | 70 ----- .../client/petstore/ruby-faraday/README.md | 4 - .../petstore/ruby-faraday/docs/FakeApi.md | 71 ----- .../ruby-faraday/lib/petstore/api/fake_api.rb | 70 ----- samples/client/petstore/ruby/README.md | 4 - samples/client/petstore/ruby/docs/FakeApi.md | 71 ----- .../ruby/lib/petstore/api/fake_api.rb | 70 ----- .../builds/default-v3.0/apis/FakeApi.ts | 49 ---- .../README.md | 5 - .../doc/FakeApi.md | 48 ---- .../lib/src/api/fake_api.dart | 83 ------ .../petstore_client_lib_fake/README.md | 5 - .../petstore_client_lib_fake/doc/FakeApi.md | 48 ---- .../lib/src/api/fake_api.dart | 85 ------ .../dart2/petstore_client_lib_fake/README.md | 4 - .../petstore_client_lib_fake/doc/FakeApi.md | 45 --- .../lib/api/fake_api.dart | 66 ----- .../client/petstore/python-legacy/README.md | 7 +- .../petstore/python-legacy/docs/FakeApi.md | 128 --------- .../petstore_api/api/fake_api.py | 151 ---------- .../petstore_api/configuration.py | 58 ---- .../cpp-restbed/generated/3_0/api/FakeApi.cpp | 134 --------- .../cpp-restbed/generated/3_0/api/FakeApi.h | 69 ----- .../petstore/java-helidon-server/mp/README.md | 1 - .../openapitools/server/api/FakeService.java | 6 - .../server/api/FakeServiceImpl.java | 7 - .../src/main/resources/META-INF/openapi.yml | 35 --- .../petstore/java-helidon-server/se/README.md | 1 - .../openapitools/server/api/FakeService.java | 10 - .../server/api/FakeServiceImpl.java | 5 - .../src/main/resources/META-INF/openapi.yml | 35 --- .../java/org/openapitools/api/FakeApi.java | 15 - .../org/openapitools/api/FakeApiService.java | 2 - .../api/impl/FakeApiServiceImpl.java | 6 - .../app/Http/Controllers/FakeController.php | 28 -- .../petstore/php-laravel/lib/routes/api.php | 7 - .../lib/app/Http/Controllers/FakeApi.php | 28 -- .../petstore/php-lumen/lib/routes/web.php | 7 - 77 files changed, 4 insertions(+), 3431 deletions(-) rename modules/openapi-generator/src/test/resources/3_0/java/{petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml => petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml} (99%) diff --git a/bin/configs/java-okhttp-gson.yaml b/bin/configs/java-okhttp-gson.yaml index e138af15401c..9d0cf6eed577 100644 --- a/bin/configs/java-okhttp-gson.yaml +++ b/bin/configs/java-okhttp-gson.yaml @@ -1,7 +1,7 @@ generatorName: java outputDir: samples/client/petstore/java/okhttp-gson library: okhttp-gson -inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: artifactId: petstore-okhttp-gson diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml similarity index 99% rename from modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml rename to modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml index 2e4c21702045..8a91d974b027 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml @@ -43,7 +43,6 @@ paths: '405': description: Invalid input security: - - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -63,7 +62,6 @@ paths: '405': description: Validation exception security: - - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -110,7 +108,6 @@ paths: '400': description: Invalid status value security: - - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -151,7 +148,6 @@ paths: '400': description: Invalid tag value security: - - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -1197,12 +1193,6 @@ components: type: http scheme: bearer bearerFormat: JWT - http_signature_test: - # Test the 'HTTP signature' security scheme. - # Each HTTP request is cryptographically signed as specified - # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ - type: http - scheme: signature schemas: Foo: type: object diff --git a/modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml index 602ba230ba5a..afdc3a76b414 100644 --- a/modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1169,32 +1169,6 @@ paths: application/json: schema: $ref: '#/components/schemas/HealthCheckResult' - /fake/http-signature-test: - get: - tags: - - fake - summary: test http signature authentication - operationId: fake-http-signature-test - parameters: - - name: query_1 - in: query - description: query parameter - required: optional - schema: - type: string - - name: header_1 - in: header - description: header parameter - required: optional - schema: - type: string - security: - - http_signature_test: [] - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - 200: - description: The instance started successfully servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server @@ -1272,9 +1246,6 @@ components: type: http scheme: bearer bearerFormat: JWT - http_signature_test: - type: http - scheme: signature schemas: Foo: type: object diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index fe954df8e429..dae7d1a42423 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1185,32 +1185,6 @@ paths: application/json: schema: $ref: '#/components/schemas/HealthCheckResult' - /fake/http-signature-test: - get: - tags: - - fake - summary: test http signature authentication - operationId: fake-http-signature-test - parameters: - - name: query_1 - in: query - description: query parameter - required: optional - schema: - type: string - - name: header_1 - in: header - description: header parameter - required: optional - schema: - type: string - security: - - http_signature_test: [] - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - 200: - description: The instance started successfully servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server @@ -1288,9 +1262,6 @@ components: type: http scheme: bearer bearerFormat: JWT - http_signature_test: - type: http - scheme: signature schemas: Foo: type: object diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml index 9dedcf305219..29d226863534 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml @@ -42,7 +42,6 @@ paths: '405': description: Invalid input security: - - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -65,7 +64,6 @@ paths: '405': description: Validation exception security: - - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -113,7 +111,6 @@ paths: '400': description: Invalid status value security: - - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -158,7 +155,6 @@ paths: '400': description: Invalid tag value security: - - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -349,7 +345,7 @@ paths: summary: Find purchase order by ID description: >- For valid response try integer IDs with value <= 5 or > 10. Other values - will generated exceptions + will generate exceptions operationId: getOrderById parameters: - name: order_id @@ -856,7 +852,7 @@ paths: format: int64 responses: '400': - description: Someting wrong + description: Something wrong /fake/outer/number: post: tags: @@ -1208,46 +1204,6 @@ paths: application/json: schema: $ref: '#/components/schemas/HealthCheckResult' - /fake/http-signature-test: - get: - tags: - - fake - summary: test http signature authentication - operationId: fake-http-signature-test - parameters: - - name: query_1 - in: query - description: query parameter - required: optional - schema: - type: string - - name: header_1 - in: header - description: header parameter - required: optional - schema: - type: string - security: - - http_signature_test: [] - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - 200: - description: The instance started successfully - /fake/any_type_body: - post: - tags: - - fake - summary: test any type request body - operationId: fakeAnyTypeRequestBody - requestBody: - content: - application/json: - schema: - type: object - responses: - 200: - description: OK servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server @@ -1325,12 +1281,6 @@ components: type: http scheme: bearer bearerFormat: JWT - http_signature_test: - # Test the 'HTTP signature' security scheme. - # Each HTTP request is cryptographically signed as specified - # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ - type: http - scheme: signature schemas: Foo: type: object diff --git a/samples/client/petstore/csharp/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md index f7defb79030c..191888b99d8a 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient/README.md @@ -108,7 +108,6 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | *FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**FakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -241,7 +240,3 @@ Class | Method | HTTP request | Description - **Type**: HTTP bearer authentication - -### http_signature_test - - diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index 73edec3b9d19..65a64380db61 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**FakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[**FakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication [**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | [**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -94,84 +93,6 @@ No authorization required [[Back to README]](../README.md) -## FakeHttpSignatureTest - -> void FakeHttpSignatureTest (Pet pet, string query1 = null, string header1 = null) - -test http signature authentication - -### Example - -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class FakeHttpSignatureTestExample - { - public static void Main() - { - Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; - - var apiInstance = new FakeApi(Configuration.Default); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store - var query1 = "query1_example"; // string | query parameter (optional) - var header1 = "header1_example"; // string | header parameter (optional) - - try - { - // test http signature authentication - apiInstance.FakeHttpSignatureTest(pet, query1, header1); - } - catch (ApiException e) - { - Debug.Print("Exception when calling FakeApi.FakeHttpSignatureTest: " + e.Message ); - Debug.Print("Status Code: "+ e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query1** | **string**| query parameter | [optional] - **header1** | **string**| header parameter | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The instance started successfully | - | - -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - ## FakeOuterBooleanSerialize > bool FakeOuterBooleanSerialize (bool? body = null) diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index f8008a03ec63..9631431c6b0d 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -45,31 +45,6 @@ public interface IFakeApi : IApiAccessor /// ApiResponse of HealthCheckResult ApiResponse FakeHealthGetWithHttpInfo (); /// - /// test http signature authentication - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Pet object that needs to be added to the store - /// query parameter (optional) - /// header parameter (optional) - /// - void FakeHttpSignatureTest (Pet pet, string query1 = default(string), string header1 = default(string)); - - /// - /// test http signature authentication - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Pet object that needs to be added to the store - /// query parameter (optional) - /// header parameter (optional) - /// ApiResponse of Object(void) - ApiResponse FakeHttpSignatureTestWithHttpInfo (Pet pet, string query1 = default(string), string header1 = default(string)); - /// /// /// /// @@ -476,33 +451,6 @@ public interface IFakeApi : IApiAccessor /// Task of ApiResponse (HealthCheckResult) System.Threading.Tasks.Task> FakeHealthGetWithHttpInfoAsync (CancellationToken cancellationToken = default(CancellationToken)); /// - /// test http signature authentication - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Pet object that needs to be added to the store - /// query parameter (optional) - /// header parameter (optional) - /// Cancellation Token to cancel request (optional) - /// Task of void - System.Threading.Tasks.Task FakeHttpSignatureTestAsync (Pet pet, string query1 = default(string), string header1 = default(string), CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// test http signature authentication - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Pet object that needs to be added to the store - /// query parameter (optional) - /// header parameter (optional) - /// Cancellation Token to cancel request (optional) - /// Task of ApiResponse - System.Threading.Tasks.Task> FakeHttpSignatureTestWithHttpInfoAsync (Pet pet, string query1 = default(string), string header1 = default(string), CancellationToken cancellationToken = default(CancellationToken)); - /// /// /// /// @@ -1149,169 +1097,6 @@ public ApiResponse FakeHealthGetWithHttpInfo () (HealthCheckResult) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(HealthCheckResult))); } - /// - /// test http signature authentication - /// - /// Thrown when fails to make API call - /// Pet object that needs to be added to the store - /// query parameter (optional) - /// header parameter (optional) - /// - public void FakeHttpSignatureTest (Pet pet, string query1 = default(string), string header1 = default(string)) - { - FakeHttpSignatureTestWithHttpInfo(pet, query1, header1); - } - - /// - /// test http signature authentication - /// - /// Thrown when fails to make API call - /// Pet object that needs to be added to the store - /// query parameter (optional) - /// header parameter (optional) - /// ApiResponse of Object(void) - public ApiResponse FakeHttpSignatureTestWithHttpInfo (Pet pet, string query1 = default(string), string header1 = default(string)) - { - // verify the required parameter 'pet' is set - if (pet == null) - throw new ApiException(400, "Missing required parameter 'pet' when calling FakeApi->FakeHttpSignatureTest"); - - var localVarPath = "/fake/http-signature-test"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (query1 != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query_1", query1)); // query parameter - if (header1 != null) localVarHeaderParams.Add("header_1", this.Configuration.ApiClient.ParameterToString(header1)); // header parameter - if (pet != null && pet.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter - } - else - { - localVarPostBody = pet; // byte array - } - - // authentication (http_signature_test) required - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("FakeHttpSignatureTest", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - null); - } - - /// - /// test http signature authentication - /// - /// Thrown when fails to make API call - /// Pet object that needs to be added to the store - /// query parameter (optional) - /// header parameter (optional) - /// Cancellation Token to cancel request (optional) - /// Task of void - public async System.Threading.Tasks.Task FakeHttpSignatureTestAsync (Pet pet, string query1 = default(string), string header1 = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - await FakeHttpSignatureTestWithHttpInfoAsync(pet, query1, header1, cancellationToken); - - } - - /// - /// test http signature authentication - /// - /// Thrown when fails to make API call - /// Pet object that needs to be added to the store - /// query parameter (optional) - /// header parameter (optional) - /// Cancellation Token to cancel request (optional) - /// Task of ApiResponse - public async System.Threading.Tasks.Task> FakeHttpSignatureTestWithHttpInfoAsync (Pet pet, string query1 = default(string), string header1 = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - // verify the required parameter 'pet' is set - if (pet == null) - throw new ApiException(400, "Missing required parameter 'pet' when calling FakeApi->FakeHttpSignatureTest"); - - var localVarPath = "/fake/http-signature-test"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (query1 != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query_1", query1)); // query parameter - if (header1 != null) localVarHeaderParams.Add("header_1", this.Configuration.ApiClient.ParameterToString(header1)); // header parameter - if (pet != null && pet.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter - } - else - { - localVarPostBody = pet; // byte array - } - - // authentication (http_signature_test) required - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, cancellationToken); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("FakeHttpSignatureTest", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - null); - } - /// /// Test serialization of outer boolean types /// diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex index e6be5c554c6f..8a1bcae0e1f2 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex @@ -37,44 +37,6 @@ defmodule OpenapiPetstore.Api.Fake do ]) end - @doc """ - test http signature authentication - - ### Parameters - - - `connection` (OpenapiPetstore.Connection): Connection to server - - `pet` (Pet): Pet object that needs to be added to the store - - `opts` (keyword): Optional parameters - - `:query_1` (String.t): query parameter - - `:header_1` (String.t): header parameter - - ### Returns - - - `{:ok, nil}` on success - - `{:error, Tesla.Env.t}` on failure - """ - @spec fake_http_signature_test(Tesla.Env.client, OpenapiPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def fake_http_signature_test(connection, pet, opts \\ []) do - optional_params = %{ - :query_1 => :query, - :header_1 => :headers - } - - request = - %{} - |> method(:get) - |> url("/fake/http-signature-test") - |> add_param(:body, :body, pet) - |> add_optional_params(optional_params, opts) - |> Enum.into([]) - - connection - |> Connection.request(request) - |> evaluate_response([ - {200, false} - ]) - end - @doc """ Test serialization of outer boolean types diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md b/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md index 6ae181e21c67..1ca0aa87e83d 100644 --- a/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md +++ b/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | -| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | | [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | @@ -54,41 +53,6 @@ No authorization required | **200** | The instance started successfully | - | -## fakeHttpSignatureTest - -> void fakeHttpSignatureTest(pet, query1, header1) - -test http signature authentication - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | -| **query1** | **String**| query parameter | [optional] | -| **header1** | **String**| header parameter | [optional] | - -### Return type - -[**void**](Void.md) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The instance started successfully | - | - - ## fakeOuterBooleanSerialize > Boolean fakeOuterBooleanSerialize(body) diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java index 122edf22556b..562123c1e59a 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java @@ -35,7 +35,6 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; -import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; /** @@ -56,14 +55,6 @@ public interface FakeApi { @Produces({ "application/json" }) HealthCheckResult fakeHealthGet() throws ApiException, ProcessingException; - /** - * test http signature authentication - */ - @GET - @Path("/http-signature-test") - @Consumes({ "application/json", "application/xml" }) - void fakeHttpSignatureTest(Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1) throws ApiException, ProcessingException; - @POST @Path("/outer/boolean") @Consumes({ "application/json" }) diff --git a/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md b/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md index 853a8de53777..224d4e56b587 100644 --- a/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md +++ b/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | -| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | | [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | @@ -84,75 +83,6 @@ No authorization required | **200** | The instance started successfully | - | -## fakeHttpSignatureTest - -> fakeHttpSignatureTest(pet, query1, header1) - -test http signature authentication - -### Example - -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - - FakeApi apiInstance = new FakeApi(defaultClient); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store - String query1 = "query1_example"; // String | query parameter - String header1 = "header1_example"; // String | header parameter - try { - apiInstance.fakeHttpSignatureTest(pet, query1, header1); - } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeHttpSignatureTest"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | -| **query1** | **String**| query parameter | [optional] | -| **header1** | **String**| header parameter | [optional] | - -### Return type - -null (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The instance started successfully | - | - - ## fakeOuterBooleanSerialize > Boolean fakeOuterBooleanSerialize(body) diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java index 01701727d04b..121995f54618 100644 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java @@ -25,7 +25,6 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; -import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; /** @@ -41,15 +40,6 @@ public interface FakeApi { */ ApiResponse fakeHealthGet(); - /** - * test http signature authentication - * @param pet Pet object that needs to be added to the store (required) - * @param query1 query parameter (optional) - * @param header1 header parameter (optional) - * @return {@code ApiResponse} - */ - ApiResponse fakeHttpSignatureTest(Pet pet, String query1, String header1); - ApiResponse fakeOuterBooleanSerialize(Boolean body); ApiResponse fakeOuterCompositeSerialize(OuterComposite outerComposite); diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java index 1b323ac2f886..1d78620df14e 100644 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -41,7 +41,6 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; -import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; import java.util.ArrayList; import org.openapitools.client.Pair; @@ -58,7 +57,6 @@ public class FakeApiImpl implements FakeApi { private final ApiClient apiClient; protected static final GenericType RESPONSE_TYPE_fakeHealthGet = ResponseType.create(HealthCheckResult.class); - protected static final GenericType RESPONSE_TYPE_fakeHttpSignatureTest = ResponseType.create(Void.class); protected static final GenericType RESPONSE_TYPE_fakeOuterBooleanSerialize = ResponseType.create(Boolean.class); protected static final GenericType RESPONSE_TYPE_fakeOuterCompositeSerialize = ResponseType.create(OuterComposite.class); protected static final GenericType RESPONSE_TYPE_fakeOuterNumberSerialize = ResponseType.create(BigDecimal.class); @@ -121,57 +119,6 @@ protected ApiResponse fakeHealthGetSubmit(WebClientRequestBui return ApiResponse.create(RESPONSE_TYPE_fakeHealthGet, webClientResponse); } - @Override - public ApiResponse fakeHttpSignatureTest(Pet pet, String query1, String header1) { - Objects.requireNonNull(pet, "Required parameter 'pet' not specified"); - WebClientRequestBuilder webClientRequestBuilder = fakeHttpSignatureTestRequestBuilder(pet, query1, header1); - return fakeHttpSignatureTestSubmit(webClientRequestBuilder, pet, query1, header1); - } - - /** - * Creates a {@code WebClientRequestBuilder} for the fakeHttpSignatureTest operation. - * Optional customization point for subclasses. - * - * @param pet Pet object that needs to be added to the store (required) - * @param query1 query parameter (optional) - * @param header1 header parameter (optional) - * @return WebClientRequestBuilder for fakeHttpSignatureTest - */ - protected WebClientRequestBuilder fakeHttpSignatureTestRequestBuilder(Pet pet, String query1, String header1) { - WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() - .method("GET"); - - List queryParams = new ArrayList<>(); - queryParams.addAll(ApiClient.parameterToPairs("query_1", query1)); - queryParams.forEach(p -> webClientRequestBuilder.queryParam(p.getName(), p.getValue())); - - WebClientRequestHeaders headers = webClientRequestBuilder.headers(); - if (header1 != null) { - headers.put("header_1", header1); - } - - webClientRequestBuilder.path("/fake/http-signature-test"); - webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); - webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); - - return webClientRequestBuilder; - } - - /** - * Initiates the request for the fakeHttpSignatureTest operation. - * Optional customization point for subclasses. - * - * @param webClientRequestBuilder the request builder to use for submitting the request - * @param pet Pet object that needs to be added to the store (required) - * @param query1 query parameter (optional) - * @param header1 header parameter (optional) - * @return {@code ApiResponse} for the submitted request - */ - protected ApiResponse fakeHttpSignatureTestSubmit(WebClientRequestBuilder webClientRequestBuilder, Pet pet, String query1, String header1) { - Single webClientResponse = webClientRequestBuilder.submit(pet); - return ApiResponse.create(RESPONSE_TYPE_fakeHttpSignatureTest, webClientResponse); - } - @Override public ApiResponse fakeOuterBooleanSerialize(Boolean body) { WebClientRequestBuilder webClientRequestBuilder = fakeOuterBooleanSerializeRequestBuilder(body); diff --git a/samples/client/petstore/java/apache-httpclient/README.md b/samples/client/petstore/java/apache-httpclient/README.md index 45ace68ceee4..008c0894e2c8 100644 --- a/samples/client/petstore/java/apache-httpclient/README.md +++ b/samples/client/petstore/java/apache-httpclient/README.md @@ -109,7 +109,6 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo | *FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -236,11 +235,6 @@ Authentication schemes defined for the API: ### bearer_test -- **Type**: HTTP basic authentication - -### http_signature_test - - - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml index 97b8e4c677a7..f098d240cd20 100644 --- a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml +++ b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml @@ -1218,38 +1218,6 @@ paths: tags: - fake x-accepts: application/json - /fake/http-signature-test: - get: - operationId: fake-http-signature-test - parameters: - - description: query parameter - explode: true - in: query - name: query_1 - required: false - schema: - type: string - style: form - - description: header parameter - explode: false - in: header - name: header_1 - required: false - schema: - type: string - style: simple - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "200": - description: The instance started successfully - security: - - http_signature_test: [] - summary: test http signature authentication - tags: - - fake - x-content-type: application/json - x-accepts: application/json components: requestBodies: UserArray: @@ -2167,7 +2135,4 @@ components: bearerFormat: JWT scheme: bearer type: http - http_signature_test: - scheme: signature - type: http diff --git a/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md b/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md index 853a8de53777..224d4e56b587 100644 --- a/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md +++ b/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | -| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | | [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | @@ -84,75 +83,6 @@ No authorization required | **200** | The instance started successfully | - | -## fakeHttpSignatureTest - -> fakeHttpSignatureTest(pet, query1, header1) - -test http signature authentication - -### Example - -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - - FakeApi apiInstance = new FakeApi(defaultClient); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store - String query1 = "query1_example"; // String | query parameter - String header1 = "header1_example"; // String | header parameter - try { - apiInstance.fakeHttpSignatureTest(pet, query1, header1); - } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeHttpSignatureTest"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | -| **query1** | **String**| query parameter | [optional] | -| **header1** | **String**| header parameter | [optional] | - -### Return type - -null (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The instance started successfully | - | - - ## fakeOuterBooleanSerialize > Boolean fakeOuterBooleanSerialize(body) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java index 727d782fb9db..eae7e81b8af4 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -30,7 +30,6 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; -import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; @@ -130,84 +129,6 @@ public HealthCheckResult fakeHealthGet(Map additionalHeaders) th ); } - /** - * test http signature authentication - * - * @param pet Pet object that needs to be added to the store (required) - * @param query1 query parameter (optional) - * @param header1 header parameter (optional) - * @throws ApiException if fails to make API call - */ - public void fakeHttpSignatureTest(Pet pet, String query1, String header1) throws ApiException { - this.fakeHttpSignatureTest(pet, query1, header1, Collections.emptyMap()); - } - - - /** - * test http signature authentication - * - * @param pet Pet object that needs to be added to the store (required) - * @param query1 query parameter (optional) - * @param header1 header parameter (optional) - * @param additionalHeaders additionalHeaders for this call - * @throws ApiException if fails to make API call - */ - public void fakeHttpSignatureTest(Pet pet, String query1, String header1, Map additionalHeaders) throws ApiException { - Object localVarPostBody = pet; - - // verify the required parameter 'pet' is set - if (pet == null) { - throw new ApiException(400, "Missing the required parameter 'pet' when calling fakeHttpSignatureTest"); - } - - // create path and map variables - String localVarPath = "/fake/http-signature-test"; - - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPair("query_1", query1)); - if (header1 != null) - localVarHeaderParams.put("header_1", apiClient.parameterToString(header1)); - - localVarHeaderParams.putAll(additionalHeaders); - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "http_signature_test" }; - - apiClient.invokeAPI( - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - null - ); - } - /** * * Test serialization of outer boolean types diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index 97b8e4c677a7..f098d240cd20 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -1218,38 +1218,6 @@ paths: tags: - fake x-accepts: application/json - /fake/http-signature-test: - get: - operationId: fake-http-signature-test - parameters: - - description: query parameter - explode: true - in: query - name: query_1 - required: false - schema: - type: string - style: form - - description: header parameter - explode: false - in: header - name: header_1 - required: false - schema: - type: string - style: simple - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "200": - description: The instance started successfully - security: - - http_signature_test: [] - summary: test http signature authentication - tags: - - fake - x-content-type: application/json - x-accepts: application/json components: requestBodies: UserArray: @@ -2167,7 +2135,4 @@ components: bearerFormat: JWT scheme: bearer type: http - http_signature_test: - scheme: signature - type: http diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java index 09b3e06ee8b4..74947f7c1572 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java @@ -69,8 +69,6 @@ public ApiClient(String[] authNames) { auth = new HttpBasicAuth(); } else if ("bearer_test".equals(authName)) { auth = new HttpBearerAuth("bearer"); - } else if ("http_signature_test".equals(authName)) { - throw new RuntimeException("auth name \"" + authName + "\" is not a supported basic auth type"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java index 6631bb71ac40..d5a40ef65455 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java @@ -14,7 +14,6 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; -import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; import java.util.ArrayList; @@ -52,95 +51,6 @@ public interface FakeApi extends ApiClient.Api { - /** - * test http signature authentication - * - * @param pet Pet object that needs to be added to the store (required) - * @param query1 query parameter (optional) - * @param header1 header parameter (optional) - */ - @RequestLine("GET /fake/http-signature-test?query_1={query1}") - @Headers({ - "Content-Type: application/json", - "Accept: application/json", - "header_1: {header1}" - }) - void fakeHttpSignatureTest(Pet pet, @Param("query1") String query1, @Param("header1") String header1); - - /** - * test http signature authentication - * Similar to fakeHttpSignatureTest but it also returns the http response headers . - * - * @param pet Pet object that needs to be added to the store (required) - * @param query1 query parameter (optional) - * @param header1 header parameter (optional) - */ - @RequestLine("GET /fake/http-signature-test?query_1={query1}") - @Headers({ - "Content-Type: application/json", - "Accept: application/json", - "header_1: {header1}" - }) - ApiResponse fakeHttpSignatureTestWithHttpInfo(Pet pet, @Param("query1") String query1, @Param("header1") String header1); - - - /** - * test http signature authentication - * - * Note, this is equivalent to the other fakeHttpSignatureTest method, - * but with the query parameters collected into a single Map parameter. This - * is convenient for services with optional query parameters, especially when - * used with the {@link FakeHttpSignatureTestQueryParams} class that allows for - * building up this map in a fluent style. - * @param pet Pet object that needs to be added to the store (required) - * @param header1 header parameter (optional) - * @param queryParams Map of query parameters as name-value pairs - *

The following elements may be specified in the query map:

- *
    - *
  • query1 - query parameter (optional)
  • - *
- */ - @RequestLine("GET /fake/http-signature-test?query_1={query1}") - @Headers({ - "Content-Type: application/json", - "Accept: application/json", - "header_1: {header1}" - }) - void fakeHttpSignatureTest(Pet pet, @Param("header1") String header1, @QueryMap(encoded=true) FakeHttpSignatureTestQueryParams queryParams); - - /** - * test http signature authentication - * - * Note, this is equivalent to the other fakeHttpSignatureTest that receives the query parameters as a map, - * but this one also exposes the Http response headers - * @param pet Pet object that needs to be added to the store (required) - * @param header1 header parameter (optional) - * @param queryParams Map of query parameters as name-value pairs - *

The following elements may be specified in the query map:

- *
    - *
  • query1 - query parameter (optional)
  • - *
- */ - @RequestLine("GET /fake/http-signature-test?query_1={query1}") - @Headers({ - "Content-Type: application/json", - "Accept: application/json", - "header_1: {header1}" - }) - ApiResponse fakeHttpSignatureTestWithHttpInfo(Pet pet, @Param("header1") String header1, @QueryMap(encoded=true) FakeHttpSignatureTestQueryParams queryParams); - - - /** - * A convenience class for generating query parameters for the - * fakeHttpSignatureTest method in a fluent style. - */ - public static class FakeHttpSignatureTestQueryParams extends HashMap { - public FakeHttpSignatureTestQueryParams query1(final String value) { - put("query_1", EncodingUtils.encode(value)); - return this; - } - } - /** * * Test serialization of outer boolean types diff --git a/samples/client/petstore/java/webclient-jakarta/README.md b/samples/client/petstore/java/webclient-jakarta/README.md index 75a5fba59e2d..67186042bca5 100644 --- a/samples/client/petstore/java/webclient-jakarta/README.md +++ b/samples/client/petstore/java/webclient-jakarta/README.md @@ -116,7 +116,6 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo | *FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -243,11 +242,6 @@ Authentication schemes defined for the API: ### bearer_test -- **Type**: HTTP basic authentication - -### http_signature_test - - - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml index 97b8e4c677a7..f098d240cd20 100644 --- a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml @@ -1218,38 +1218,6 @@ paths: tags: - fake x-accepts: application/json - /fake/http-signature-test: - get: - operationId: fake-http-signature-test - parameters: - - description: query parameter - explode: true - in: query - name: query_1 - required: false - schema: - type: string - style: form - - description: header parameter - explode: false - in: header - name: header_1 - required: false - schema: - type: string - style: simple - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "200": - description: The instance started successfully - security: - - http_signature_test: [] - summary: test http signature authentication - tags: - - fake - x-content-type: application/json - x-accepts: application/json components: requestBodies: UserArray: @@ -2167,7 +2135,4 @@ components: bearerFormat: JWT scheme: bearer type: http - http_signature_test: - scheme: signature - type: http diff --git a/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md b/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md index 853a8de53777..224d4e56b587 100644 --- a/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | -| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | | [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | @@ -84,75 +83,6 @@ No authorization required | **200** | The instance started successfully | - | -## fakeHttpSignatureTest - -> fakeHttpSignatureTest(pet, query1, header1) - -test http signature authentication - -### Example - -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - - FakeApi apiInstance = new FakeApi(defaultClient); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store - String query1 = "query1_example"; // String | query parameter - String header1 = "header1_example"; // String | header parameter - try { - apiInstance.fakeHttpSignatureTest(pet, query1, header1); - } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeHttpSignatureTest"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | -| **query1** | **String**| query parameter | [optional] | -| **header1** | **String**| header parameter | [optional] | - -### Return type - -null (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The instance started successfully | - | - - ## fakeOuterBooleanSerialize > Boolean fakeOuterBooleanSerialize(body) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/api/FakeApi.java index cbb1804a4955..c0474abd7eef 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/api/FakeApi.java @@ -12,7 +12,6 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; -import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; import java.util.HashMap; @@ -121,87 +120,6 @@ public Mono> fakeHealthGetWithHttpInfo() throw public ResponseSpec fakeHealthGetWithResponseSpec() throws WebClientResponseException { return fakeHealthGetRequestCreation(); } - /** - * test http signature authentication - * - *

200 - The instance started successfully - * @param pet Pet object that needs to be added to the store - * @param query1 query parameter - * @param header1 header parameter - * @throws WebClientResponseException if an error occurs while attempting to invoke the API - */ - private ResponseSpec fakeHttpSignatureTestRequestCreation(Pet pet, String query1, String header1) throws WebClientResponseException { - Object postBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - throw new WebClientResponseException("Missing the required parameter 'pet' when calling fakeHttpSignatureTest", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); - } - // create path and map variables - final Map pathParams = new HashMap(); - - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); - - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query_1", query1)); - - if (header1 != null) - headerParams.add("header_1", apiClient.parameterToString(header1)); - final String[] localVarAccepts = { }; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "http_signature_test" }; - - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/http-signature-test", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - - /** - * test http signature authentication - * - *

200 - The instance started successfully - * @param pet Pet object that needs to be added to the store - * @param query1 query parameter - * @param header1 header parameter - * @throws WebClientResponseException if an error occurs while attempting to invoke the API - */ - public Mono fakeHttpSignatureTest(Pet pet, String query1, String header1) throws WebClientResponseException { - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return fakeHttpSignatureTestRequestCreation(pet, query1, header1).bodyToMono(localVarReturnType); - } - - /** - * test http signature authentication - * - *

200 - The instance started successfully - * @param pet Pet object that needs to be added to the store - * @param query1 query parameter - * @param header1 header parameter - * @throws WebClientResponseException if an error occurs while attempting to invoke the API - */ - public Mono> fakeHttpSignatureTestWithHttpInfo(Pet pet, String query1, String header1) throws WebClientResponseException { - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return fakeHttpSignatureTestRequestCreation(pet, query1, header1).toEntity(localVarReturnType); - } - - /** - * test http signature authentication - * - *

200 - The instance started successfully - * @param pet Pet object that needs to be added to the store - * @param query1 query parameter - * @param header1 header parameter - * @return ResponseSpec - * @throws WebClientResponseException if an error occurs while attempting to invoke the API - */ - public ResponseSpec fakeHttpSignatureTestWithResponseSpec(Pet pet, String query1, String header1) throws WebClientResponseException { - return fakeHttpSignatureTestRequestCreation(pet, query1, header1); - } /** * * Test serialization of outer boolean types diff --git a/samples/client/petstore/java/webclient/README.md b/samples/client/petstore/java/webclient/README.md index 75a5fba59e2d..67186042bca5 100644 --- a/samples/client/petstore/java/webclient/README.md +++ b/samples/client/petstore/java/webclient/README.md @@ -116,7 +116,6 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo | *FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -243,11 +242,6 @@ Authentication schemes defined for the API: ### bearer_test -- **Type**: HTTP basic authentication - -### http_signature_test - - - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index 97b8e4c677a7..f098d240cd20 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -1218,38 +1218,6 @@ paths: tags: - fake x-accepts: application/json - /fake/http-signature-test: - get: - operationId: fake-http-signature-test - parameters: - - description: query parameter - explode: true - in: query - name: query_1 - required: false - schema: - type: string - style: form - - description: header parameter - explode: false - in: header - name: header_1 - required: false - schema: - type: string - style: simple - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "200": - description: The instance started successfully - security: - - http_signature_test: [] - summary: test http signature authentication - tags: - - fake - x-content-type: application/json - x-accepts: application/json components: requestBodies: UserArray: @@ -2167,7 +2135,4 @@ components: bearerFormat: JWT scheme: bearer type: http - http_signature_test: - scheme: signature - type: http diff --git a/samples/client/petstore/java/webclient/docs/FakeApi.md b/samples/client/petstore/java/webclient/docs/FakeApi.md index 853a8de53777..224d4e56b587 100644 --- a/samples/client/petstore/java/webclient/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient/docs/FakeApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | -| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | | [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | @@ -84,75 +83,6 @@ No authorization required | **200** | The instance started successfully | - | -## fakeHttpSignatureTest - -> fakeHttpSignatureTest(pet, query1, header1) - -test http signature authentication - -### Example - -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - - FakeApi apiInstance = new FakeApi(defaultClient); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store - String query1 = "query1_example"; // String | query parameter - String header1 = "header1_example"; // String | header parameter - try { - apiInstance.fakeHttpSignatureTest(pet, query1, header1); - } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeHttpSignatureTest"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | -| **query1** | **String**| query parameter | [optional] | -| **header1** | **String**| header parameter | [optional] | - -### Return type - -null (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | The instance started successfully | - | - - ## fakeOuterBooleanSerialize > Boolean fakeOuterBooleanSerialize(body) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index 5c63a2ddbc1a..0e8d76df7462 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -12,7 +12,6 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; -import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; import java.util.HashMap; @@ -121,87 +120,6 @@ public Mono> fakeHealthGetWithHttpInfo() throw public ResponseSpec fakeHealthGetWithResponseSpec() throws WebClientResponseException { return fakeHealthGetRequestCreation(); } - /** - * test http signature authentication - * - *

200 - The instance started successfully - * @param pet Pet object that needs to be added to the store - * @param query1 query parameter - * @param header1 header parameter - * @throws WebClientResponseException if an error occurs while attempting to invoke the API - */ - private ResponseSpec fakeHttpSignatureTestRequestCreation(Pet pet, String query1, String header1) throws WebClientResponseException { - Object postBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - throw new WebClientResponseException("Missing the required parameter 'pet' when calling fakeHttpSignatureTest", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); - } - // create path and map variables - final Map pathParams = new HashMap(); - - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); - - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query_1", query1)); - - if (header1 != null) - headerParams.add("header_1", apiClient.parameterToString(header1)); - final String[] localVarAccepts = { }; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "http_signature_test" }; - - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/http-signature-test", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - - /** - * test http signature authentication - * - *

200 - The instance started successfully - * @param pet Pet object that needs to be added to the store - * @param query1 query parameter - * @param header1 header parameter - * @throws WebClientResponseException if an error occurs while attempting to invoke the API - */ - public Mono fakeHttpSignatureTest(Pet pet, String query1, String header1) throws WebClientResponseException { - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return fakeHttpSignatureTestRequestCreation(pet, query1, header1).bodyToMono(localVarReturnType); - } - - /** - * test http signature authentication - * - *

200 - The instance started successfully - * @param pet Pet object that needs to be added to the store - * @param query1 query parameter - * @param header1 header parameter - * @throws WebClientResponseException if an error occurs while attempting to invoke the API - */ - public Mono> fakeHttpSignatureTestWithHttpInfo(Pet pet, String query1, String header1) throws WebClientResponseException { - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return fakeHttpSignatureTestRequestCreation(pet, query1, header1).toEntity(localVarReturnType); - } - - /** - * test http signature authentication - * - *

200 - The instance started successfully - * @param pet Pet object that needs to be added to the store - * @param query1 query parameter - * @param header1 header parameter - * @return ResponseSpec - * @throws WebClientResponseException if an error occurs while attempting to invoke the API - */ - public ResponseSpec fakeHttpSignatureTestWithResponseSpec(Pet pet, String query1, String header1) throws WebClientResponseException { - return fakeHttpSignatureTestRequestCreation(pet, query1, header1); - } /** * * Test serialization of outer boolean types diff --git a/samples/client/petstore/k6/script.js b/samples/client/petstore/k6/script.js index a0ba72b227ae..8e523ef01319 100644 --- a/samples/client/petstore/k6/script.js +++ b/samples/client/petstore/k6/script.js @@ -20,7 +20,6 @@ const BASE_URL = "https://127.0.0.1/no_varaible"; const SLEEP_DURATION = 0.1; // Global variables should be initialized. let booleanGroup = "TODO_EDIT_THE_BOOLEAN_GROUP"; -let header1 = "TODO_EDIT_THE_HEADER_1"; let apiKey = "TODO_EDIT_THE_API_KEY"; let requiredBooleanGroup = "TODO_EDIT_THE_REQUIRED_BOOLEAN_GROUP"; let enumHeaderStringArray = "TODO_EDIT_THE_ENUM_HEADER_STRING_ARRAY"; @@ -425,23 +424,6 @@ export default function() { } }); - group("/fake/http-signature-test", () => { - let query1 = 'TODO_EDIT_THE_QUERY_1'; // specify value as there is no example value for this parameter in OpenAPI spec - - // Request No. 1: fake-http-signature-test - { - let url = BASE_URL + `/fake/http-signature-test?query_1=${query_1}`; - // TODO: edit the parameters of the request body. - let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "set", "tags": "list", "status": "string"}; - let params = {headers: {"Content-Type": "application/json", "header_1": `${header1}`, "Accept": "application/json"}}; - let request = http.get(url, JSON.stringify(body), params); - - check(request, { - "The instance started successfully": (r) => r.status === 200 - }); - } - }); - group("/user", () => { // Request No. 1: createUser diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 17380420a74b..e0a73c8057b3 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -387,7 +387,6 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | *FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -509,7 +508,3 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication -## http_signature_test - -- **Type**: HTTP basic authentication - diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index e028d69b6c3a..734d7de7e0d3 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -10,7 +10,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -68,56 +67,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **fake_http_signature_test** -> fake_http_signature_test(pet => $pet, query_1 => $query_1, header_1 => $header_1) - -test http signature authentication - -### Example -```perl -use Data::Dumper; -use WWW::OpenAPIClient::FakeApi; -my $api_instance = WWW::OpenAPIClient::FakeApi->new( - - # Configure HTTP basic authorization: http_signature_test - -); - -my $pet = WWW::OpenAPIClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store -my $query_1 = "query_1_example"; # string | query parameter -my $header_1 = "header_1_example"; # string | header parameter - -eval { - $api_instance->fake_http_signature_test(pet => $pet, query_1 => $query_1, header_1 => $header_1); -}; -if ($@) { - warn "Exception when calling FakeApi->fake_http_signature_test: $@\n"; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query_1** | **string**| query parameter | [optional] - **header_1** | **string**| header parameter | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **fake_outer_boolean_serialize** > boolean fake_outer_boolean_serialize(body => $body) diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/ApiClient.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/ApiClient.pm index 335cffb1ed48..b76d30c5c5b2 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/ApiClient.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/ApiClient.pm @@ -369,8 +369,6 @@ sub update_params_for_auth { $header_params->{'Authorization'} = 'Bearer ' . $self->{config}{access_token}; } } - elsif ($auth eq 'http_signature_test') { - } else { # TODO show warning about security definition not found } diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm index 2712407215f0..f93529f9294b 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm @@ -97,89 +97,6 @@ sub fake_health_get { return $_response_object; } -# -# fake_http_signature_test -# -# test http signature authentication -# -# @param Pet $pet Pet object that needs to be added to the store (required) -# @param string $query_1 query parameter (optional) -# @param string $header_1 header parameter (optional) -{ - my $params = { - 'pet' => { - data_type => 'Pet', - description => 'Pet object that needs to be added to the store', - required => '1', - }, - 'query_1' => { - data_type => 'string', - description => 'query parameter', - required => '0', - }, - 'header_1' => { - data_type => 'string', - description => 'header parameter', - required => '0', - }, - }; - __PACKAGE__->method_documentation->{ 'fake_http_signature_test' } = { - summary => 'test http signature authentication', - params => $params, - returns => undef, - }; -} -# @return void -# -sub fake_http_signature_test { - my ($self, %args) = @_; - - # verify the required parameter 'pet' is set - unless (exists $args{'pet'}) { - croak("Missing the required parameter 'pet' when calling fake_http_signature_test"); - } - - # parse inputs - my $_resource_path = '/fake/http-signature-test'; - - my $_method = 'GET'; - my $query_params = {}; - my $header_params = {}; - my $form_params = {}; - - # 'Accept' and 'Content-Type' header - my $_header_accept = $self->{api_client}->select_header_accept(); - if ($_header_accept) { - $header_params->{'Accept'} = $_header_accept; - } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', 'application/xml'); - - # query params - if ( exists $args{'query_1'}) { - $query_params->{'query_1'} = $self->{api_client}->to_query_value($args{'query_1'}); - } - - # header params - if ( exists $args{'header_1'}) { - $header_params->{'header_1'} = $self->{api_client}->to_header_value($args{'header_1'}); - } - - my $_body_data; - # body params - if ( exists $args{'pet'}) { - $_body_data = $args{'pet'}; - } - - # authentication setting, if any - my $auth_settings = [qw(http_signature_test )]; - - # make the API Call - $self->{api_client}->call_api($_resource_path, $_method, - $query_params, $form_params, - $header_params, $_body_data, $auth_settings); - return; -} - # # fake_outer_boolean_serialize # diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index b68c5316fdc3..42f351970f8c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -75,7 +75,6 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**call123TestSpecialTags**](docs/Api/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**fooGet**](docs/Api/DefaultApi.md#fooget) | **GET** /foo | *FakeApi* | [**fakeHealthGet**](docs/Api/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fakeHttpSignatureTest**](docs/Api/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -202,9 +201,6 @@ Class | Method | HTTP request | Description - **Type**: Bearer authentication (JWT) - -### http_signature_test - ## Tests To run the tests, use: diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md index 69af2914b902..77afcc34937d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -5,7 +5,6 @@ All URIs are relative to http://petstore.swagger.io:80/v2, except if the operati | Method | HTTP request | Description | | ------------- | ------------- | ------------- | | [**fakeHealthGet()**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | -| [**fakeHttpSignatureTest()**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | | [**fakeOuterBooleanSerialize()**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | | [**fakeOuterCompositeSerialize()**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | | [**fakeOuterNumberSerialize()**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | @@ -74,65 +73,6 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `fakeHttpSignatureTest()` - -```php -fakeHttpSignatureTest($pet, $query_1, $header_1) -``` - -test http signature authentication - -### Example - -```php -fakeHttpSignatureTest($pet, $query_1, $header_1); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->fakeHttpSignatureTest: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | | -| **query_1** | **string**| query parameter | [optional] | -| **header_1** | **string**| header parameter | [optional] | - -### Return type - -void (empty response body) - -### Authorization - -[http_signature_test](../../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: `application/json`, `application/xml` -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - ## `fakeOuterBooleanSerialize()` ```php diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index b822b8334cdf..6ab4d288a752 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -74,10 +74,6 @@ class FakeApi 'fakeHealthGet' => [ 'application/json', ], - 'fakeHttpSignatureTest' => [ - 'application/json', - 'application/xml', - ], 'fakeOuterBooleanSerialize' => [ 'application/json', ], @@ -434,259 +430,6 @@ public function fakeHealthGetRequest(string $contentType = self::contentTypes['f ); } - /** - * Operation fakeHttpSignatureTest - * - * test http signature authentication - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function fakeHttpSignatureTest($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeHttpSignatureTest'][0]) - { - $this->fakeHttpSignatureTestWithHttpInfo($pet, $query_1, $header_1, $contentType); - } - - /** - * Operation fakeHttpSignatureTestWithHttpInfo - * - * test http signature authentication - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function fakeHttpSignatureTestWithHttpInfo($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeHttpSignatureTest'][0]) - { - $request = $this->fakeHttpSignatureTestRequest($pet, $query_1, $header_1, $contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation fakeHttpSignatureTestAsync - * - * test http signature authentication - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeHttpSignatureTestAsync($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeHttpSignatureTest'][0]) - { - return $this->fakeHttpSignatureTestAsyncWithHttpInfo($pet, $query_1, $header_1, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation fakeHttpSignatureTestAsyncWithHttpInfo - * - * test http signature authentication - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeHttpSignatureTestAsyncWithHttpInfo($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeHttpSignatureTest'][0]) - { - $returnType = ''; - $request = $this->fakeHttpSignatureTestRequest($pet, $query_1, $header_1, $contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'fakeHttpSignatureTest' - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function fakeHttpSignatureTestRequest($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeHttpSignatureTest'][0]) - { - - // verify the required parameter 'pet' is set - if ($pet === null || (is_array($pet) && count($pet) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $pet when calling fakeHttpSignatureTest' - ); - } - - - - - $resourcePath = '/fake/http-signature-test'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $query_1, - 'query_1', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - - // header params - if ($header_1 !== null) { - $headerParams['header_1'] = ObjectSerializer::toHeaderValue($header_1); - } - - - - $headers = $this->headerSelector->selectHeaders( - [], - $contentType, - $multipart - ); - - // for model (json/xml) - if (isset($pet)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pet)); - } else { - $httpBody = $pet; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'GET', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - /** * Operation fakeOuterBooleanSerialize * diff --git a/samples/client/petstore/ruby-autoload/README.md b/samples/client/petstore/ruby-autoload/README.md index b0f3201a1849..12e8bf340d1e 100644 --- a/samples/client/petstore/ruby-autoload/README.md +++ b/samples/client/petstore/ruby-autoload/README.md @@ -78,7 +78,6 @@ Class | Method | HTTP request | Description *Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | *Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -*Petstore::FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -205,6 +204,3 @@ Class | Method | HTTP request | Description - **Type**: Bearer authentication (JWT) -### http_signature_test - - diff --git a/samples/client/petstore/ruby-autoload/docs/FakeApi.md b/samples/client/petstore/ruby-autoload/docs/FakeApi.md index 71fc522caf26..e2a1a0195f84 100644 --- a/samples/client/petstore/ruby-autoload/docs/FakeApi.md +++ b/samples/client/petstore/ruby-autoload/docs/FakeApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | | [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint | -| [**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication | | [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | | | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | | | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | | @@ -82,76 +81,6 @@ No authorization required - **Accept**: application/json -## fake_http_signature_test - -> fake_http_signature_test(pet, opts) - -test http signature authentication - -### Examples - -```ruby -require 'time' -require 'petstore' -# setup authorization -Petstore.configure do |config| -end - -api_instance = Petstore::FakeApi.new -pet = Petstore::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store -opts = { - query_1: 'query_1_example', # String | query parameter - header_1: 'header_1_example' # String | header parameter -} - -begin - # test http signature authentication - api_instance.fake_http_signature_test(pet, opts) -rescue Petstore::ApiError => e - puts "Error when calling FakeApi->fake_http_signature_test: #{e}" -end -``` - -#### Using the fake_http_signature_test_with_http_info variant - -This returns an Array which contains the response data (`nil` in this case), status code and headers. - -> fake_http_signature_test_with_http_info(pet, opts) - -```ruby -begin - # test http signature authentication - data, status_code, headers = api_instance.fake_http_signature_test_with_http_info(pet, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => nil -rescue Petstore::ApiError => e - puts "Error when calling FakeApi->fake_http_signature_test_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | -| **query_1** | **String** | query parameter | [optional] | -| **header_1** | **String** | header parameter | [optional] | - -### Return type - -nil (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - ## fake_outer_boolean_serialize > Boolean fake_outer_boolean_serialize(opts) diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb index 196bfc63bf70..433d394c0d44 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb @@ -74,76 +74,6 @@ def fake_health_get_with_http_info(opts = {}) return data, status_code, headers end - # test http signature authentication - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @option opts [String] :query_1 query parameter - # @option opts [String] :header_1 header parameter - # @return [nil] - def fake_http_signature_test(pet, opts = {}) - fake_http_signature_test_with_http_info(pet, opts) - nil - end - - # test http signature authentication - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @option opts [String] :query_1 query parameter - # @option opts [String] :header_1 header parameter - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def fake_http_signature_test_with_http_info(pet, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_http_signature_test ...' - end - # verify the required parameter 'pet' is set - if @api_client.config.client_side_validation && pet.nil? - fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_http_signature_test" - end - # resource path - local_var_path = '/fake/http-signature-test' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json', 'application/xml']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - header_params[:'header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(pet) - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['http_signature_test'] - - new_options = opts.merge( - :operation => :"FakeApi.fake_http_signature_test", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_http_signature_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Test serialization of outer boolean types # @param [Hash] opts the optional parameters # @option opts [Boolean] :body Input boolean as post body diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index b0f3201a1849..12e8bf340d1e 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -78,7 +78,6 @@ Class | Method | HTTP request | Description *Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | *Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -*Petstore::FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -205,6 +204,3 @@ Class | Method | HTTP request | Description - **Type**: Bearer authentication (JWT) -### http_signature_test - - diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index 71fc522caf26..e2a1a0195f84 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | | [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint | -| [**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication | | [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | | | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | | | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | | @@ -82,76 +81,6 @@ No authorization required - **Accept**: application/json -## fake_http_signature_test - -> fake_http_signature_test(pet, opts) - -test http signature authentication - -### Examples - -```ruby -require 'time' -require 'petstore' -# setup authorization -Petstore.configure do |config| -end - -api_instance = Petstore::FakeApi.new -pet = Petstore::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store -opts = { - query_1: 'query_1_example', # String | query parameter - header_1: 'header_1_example' # String | header parameter -} - -begin - # test http signature authentication - api_instance.fake_http_signature_test(pet, opts) -rescue Petstore::ApiError => e - puts "Error when calling FakeApi->fake_http_signature_test: #{e}" -end -``` - -#### Using the fake_http_signature_test_with_http_info variant - -This returns an Array which contains the response data (`nil` in this case), status code and headers. - -> fake_http_signature_test_with_http_info(pet, opts) - -```ruby -begin - # test http signature authentication - data, status_code, headers = api_instance.fake_http_signature_test_with_http_info(pet, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => nil -rescue Petstore::ApiError => e - puts "Error when calling FakeApi->fake_http_signature_test_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | -| **query_1** | **String** | query parameter | [optional] | -| **header_1** | **String** | header parameter | [optional] | - -### Return type - -nil (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - ## fake_outer_boolean_serialize > Boolean fake_outer_boolean_serialize(opts) diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index 196bfc63bf70..433d394c0d44 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -74,76 +74,6 @@ def fake_health_get_with_http_info(opts = {}) return data, status_code, headers end - # test http signature authentication - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @option opts [String] :query_1 query parameter - # @option opts [String] :header_1 header parameter - # @return [nil] - def fake_http_signature_test(pet, opts = {}) - fake_http_signature_test_with_http_info(pet, opts) - nil - end - - # test http signature authentication - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @option opts [String] :query_1 query parameter - # @option opts [String] :header_1 header parameter - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def fake_http_signature_test_with_http_info(pet, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_http_signature_test ...' - end - # verify the required parameter 'pet' is set - if @api_client.config.client_side_validation && pet.nil? - fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_http_signature_test" - end - # resource path - local_var_path = '/fake/http-signature-test' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json', 'application/xml']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - header_params[:'header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(pet) - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['http_signature_test'] - - new_options = opts.merge( - :operation => :"FakeApi.fake_http_signature_test", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_http_signature_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Test serialization of outer boolean types # @param [Hash] opts the optional parameters # @option opts [Boolean] :body Input boolean as post body diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index b0f3201a1849..12e8bf340d1e 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -78,7 +78,6 @@ Class | Method | HTTP request | Description *Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | *Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -*Petstore::FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -205,6 +204,3 @@ Class | Method | HTTP request | Description - **Type**: Bearer authentication (JWT) -### http_signature_test - - diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 71fc522caf26..e2a1a0195f84 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | | [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint | -| [**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication | | [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | | | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | | | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | | @@ -82,76 +81,6 @@ No authorization required - **Accept**: application/json -## fake_http_signature_test - -> fake_http_signature_test(pet, opts) - -test http signature authentication - -### Examples - -```ruby -require 'time' -require 'petstore' -# setup authorization -Petstore.configure do |config| -end - -api_instance = Petstore::FakeApi.new -pet = Petstore::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store -opts = { - query_1: 'query_1_example', # String | query parameter - header_1: 'header_1_example' # String | header parameter -} - -begin - # test http signature authentication - api_instance.fake_http_signature_test(pet, opts) -rescue Petstore::ApiError => e - puts "Error when calling FakeApi->fake_http_signature_test: #{e}" -end -``` - -#### Using the fake_http_signature_test_with_http_info variant - -This returns an Array which contains the response data (`nil` in this case), status code and headers. - -> fake_http_signature_test_with_http_info(pet, opts) - -```ruby -begin - # test http signature authentication - data, status_code, headers = api_instance.fake_http_signature_test_with_http_info(pet, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => nil -rescue Petstore::ApiError => e - puts "Error when calling FakeApi->fake_http_signature_test_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | -| **query_1** | **String** | query parameter | [optional] | -| **header_1** | **String** | header parameter | [optional] | - -### Return type - -nil (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - ## fake_outer_boolean_serialize > Boolean fake_outer_boolean_serialize(opts) diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 196bfc63bf70..433d394c0d44 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -74,76 +74,6 @@ def fake_health_get_with_http_info(opts = {}) return data, status_code, headers end - # test http signature authentication - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @option opts [String] :query_1 query parameter - # @option opts [String] :header_1 header parameter - # @return [nil] - def fake_http_signature_test(pet, opts = {}) - fake_http_signature_test_with_http_info(pet, opts) - nil - end - - # test http signature authentication - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @option opts [String] :query_1 query parameter - # @option opts [String] :header_1 header parameter - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def fake_http_signature_test_with_http_info(pet, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_http_signature_test ...' - end - # verify the required parameter 'pet' is set - if @api_client.config.client_side_validation && pet.nil? - fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_http_signature_test" - end - # resource path - local_var_path = '/fake/http-signature-test' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json', 'application/xml']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - header_params[:'header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(pet) - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['http_signature_test'] - - new_options = opts.merge( - :operation => :"FakeApi.fake_http_signature_test", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_http_signature_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Test serialization of outer boolean types # @param [Hash] opts the optional parameters # @option opts [Boolean] :body Input boolean as post body diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts index a34da5fccb9f..3e14991d75dc 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts @@ -21,7 +21,6 @@ import type { HealthCheckResult, OuterComposite, OuterObjectWithEnumProperty, - Pet, User, } from '../models'; import { @@ -37,18 +36,10 @@ import { OuterCompositeToJSON, OuterObjectWithEnumPropertyFromJSON, OuterObjectWithEnumPropertyToJSON, - PetFromJSON, - PetToJSON, UserFromJSON, UserToJSON, } from '../models'; -export interface FakeHttpSignatureTestRequest { - pet: Pet; - query1?: string; - header1?: string; -} - export interface FakeOuterBooleanSerializeRequest { body?: boolean; } @@ -174,46 +165,6 @@ export class FakeApi extends runtime.BaseAPI { return await response.value(); } - /** - * test http signature authentication - */ - async fakeHttpSignatureTestRaw(requestParameters: FakeHttpSignatureTestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.pet === null || requestParameters.pet === undefined) { - throw new runtime.RequiredError('pet','Required parameter requestParameters.pet was null or undefined when calling fakeHttpSignatureTest.'); - } - - const queryParameters: any = {}; - - if (requestParameters.query1 !== undefined) { - queryParameters['query_1'] = requestParameters.query1; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (requestParameters.header1 !== undefined && requestParameters.header1 !== null) { - headerParameters['header_1'] = String(requestParameters.header1); - } - - const response = await this.request({ - path: `/fake/http-signature-test`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - body: PetToJSON(requestParameters.pet), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * test http signature authentication - */ - async fakeHttpSignatureTest(requestParameters: FakeHttpSignatureTestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.fakeHttpSignatureTestRaw(requestParameters, initOverrides); - } - /** * Test serialization of outer boolean types */ diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md index 152c6163d770..03bdac5a4b33 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md @@ -68,7 +68,6 @@ Class | Method | HTTP request | Description [*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags [*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo | [*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication [*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | [*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | [*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -192,10 +191,6 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication -## http_signature_test - -- **Type**: HTTP basic authentication - ## Author diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md index 3d408769d11e..88334b8402df 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md @@ -10,7 +10,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication [**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -65,53 +64,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **fakeHttpSignatureTest** -> fakeHttpSignatureTest(pet, query1, header1) - -test http signature authentication - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure HTTP basic authorization: http_signature_test -//defaultApiClient.getAuthentication('http_signature_test').username = 'YOUR_USERNAME' -//defaultApiClient.getAuthentication('http_signature_test').password = 'YOUR_PASSWORD'; - -final api = Openapi().getFakeApi(); -final Pet pet = ; // Pet | Pet object that needs to be added to the store -final String query1 = query1_example; // String | query parameter -final String header1 = header1_example; // String | header parameter - -try { - api.fakeHttpSignatureTest(pet, query1, header1); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query1** | **String**| query parameter | [optional] - **header1** | **String**| header parameter | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **fakeOuterBooleanSerialize** > bool fakeOuterBooleanSerialize(body) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart index 6cb86a6e440a..531534e89a57 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart @@ -15,7 +15,6 @@ import 'package:openapi/src/model/model_client.dart'; import 'package:openapi/src/model/model_enum_class.dart'; import 'package:openapi/src/model/outer_composite.dart'; import 'package:openapi/src/model/outer_object_with_enum_property.dart'; -import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/user.dart'; class FakeApi { @@ -92,88 +91,6 @@ _responseData = deserialize(_response.data ); } - /// test http signature authentication - /// - /// - /// Parameters: - /// * [pet] - Pet object that needs to be added to the store - /// * [query1] - query parameter - /// * [header1] - header parameter - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> fakeHttpSignatureTest({ - required Pet pet, - String? query1, - String? header1, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/http-signature-test'; - final _options = Options( - method: r'GET', - headers: { - if (header1 != null) r'header_1': header1, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'signature', - 'name': 'http_signature_test', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (query1 != null) r'query_1': query1, - }; - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(pet); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - /// fakeOuterBooleanSerialize /// Test serialization of outer boolean types /// diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md index 12076ad230c7..2eaf9103aee9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md @@ -67,7 +67,6 @@ Class | Method | HTTP request | Description [*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags [*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo | [*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication [*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | [*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | [*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -191,10 +190,6 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication -## http_signature_test - -- **Type**: HTTP basic authentication - ## Author diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md index 4b1e2a2d5b17..75b02209d6a5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md @@ -10,7 +10,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication [**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -65,53 +64,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **fakeHttpSignatureTest** -> fakeHttpSignatureTest(pet, query1, header1) - -test http signature authentication - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure HTTP basic authorization: http_signature_test -//defaultApiClient.getAuthentication('http_signature_test').username = 'YOUR_USERNAME' -//defaultApiClient.getAuthentication('http_signature_test').password = 'YOUR_PASSWORD'; - -final api = Openapi().getFakeApi(); -final Pet pet = ; // Pet | Pet object that needs to be added to the store -final String query1 = query1_example; // String | query parameter -final String header1 = header1_example; // String | header parameter - -try { - api.fakeHttpSignatureTest(pet, query1, header1); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query1** | **String**| query parameter | [optional] - **header1** | **String**| header parameter | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **fakeOuterBooleanSerialize** > bool fakeOuterBooleanSerialize(body) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart index 3a88d009d925..41e283862412 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart @@ -17,7 +17,6 @@ import 'package:openapi/src/model/model_client.dart'; import 'package:openapi/src/model/model_enum_class.dart'; import 'package:openapi/src/model/outer_composite.dart'; import 'package:openapi/src/model/outer_object_with_enum_property.dart'; -import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/user.dart'; class FakeApi { @@ -101,90 +100,6 @@ class FakeApi { ); } - /// test http signature authentication - /// - /// - /// Parameters: - /// * [pet] - Pet object that needs to be added to the store - /// * [query1] - query parameter - /// * [header1] - header parameter - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> fakeHttpSignatureTest({ - required Pet pet, - String? query1, - String? header1, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/http-signature-test'; - final _options = Options( - method: r'GET', - headers: { - if (header1 != null) r'header_1': header1, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'signature', - 'name': 'http_signature_test', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (query1 != null) r'query_1': encodeQueryParameter(_serializers, query1, const FullType(String)), - }; - - dynamic _bodyData; - - try { - const _type = FullType(Pet); - _bodyData = _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - /// fakeOuterBooleanSerialize /// Test serialization of outer boolean types /// diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md index ed181f1495b2..e70f2a5b2b14 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md @@ -61,7 +61,6 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**call123testSpecialTags**](doc//AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**fooGet**](doc//DefaultApi.md#fooget) | **GET** /foo | *FakeApi* | [**fakeHealthGet**](doc//FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fakeHttpSignatureTest**](doc//FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fakeOuterBooleanSerialize**](doc//FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](doc//FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](doc//FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -185,9 +184,6 @@ Class | Method | HTTP request | Description - **Type**: HTTP Bearer authentication -## http_signature_test - - ## Author diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md index 0bb17eb79f7b..9a8b710668a0 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md @@ -10,7 +10,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication [**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -65,50 +64,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **fakeHttpSignatureTest** -> fakeHttpSignatureTest(pet, query1, header1) - -test http signature authentication - -### Example -```dart -import 'package:openapi/api.dart'; - -final api_instance = FakeApi(); -final pet = Pet(); // Pet | Pet object that needs to be added to the store -final query1 = query1_example; // String | query parameter -final header1 = header1_example; // String | header parameter - -try { - api_instance.fakeHttpSignatureTest(pet, query1, header1); -} catch (e) { - print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query1** | **String**| query parameter | [optional] - **header1** | **String**| header parameter | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **fakeOuterBooleanSerialize** > bool fakeOuterBooleanSerialize(body) diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart index 6cfbfb4e6c93..bed10db56d58 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart @@ -60,72 +60,6 @@ class FakeApi { return null; } - /// test http signature authentication - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [Pet] pet (required): - /// Pet object that needs to be added to the store - /// - /// * [String] query1: - /// query parameter - /// - /// * [String] header1: - /// header parameter - Future fakeHttpSignatureTestWithHttpInfo(Pet pet, { String? query1, String? header1, }) async { - // ignore: prefer_const_declarations - final path = r'/fake/http-signature-test'; - - // ignore: prefer_final_locals - Object? postBody = pet; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (query1 != null) { - queryParams.addAll(_queryParams('', 'query_1', query1)); - } - - if (header1 != null) { - headerParams[r'header_1'] = parameterToString(header1); - } - - const contentTypes = ['application/json', 'application/xml']; - - - return apiClient.invokeAPI( - path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// test http signature authentication - /// - /// Parameters: - /// - /// * [Pet] pet (required): - /// Pet object that needs to be added to the store - /// - /// * [String] query1: - /// query parameter - /// - /// * [String] header1: - /// header parameter - Future fakeHttpSignatureTest(Pet pet, { String? query1, String? header1, }) async { - final response = await fakeHttpSignatureTestWithHttpInfo(pet, query1: query1, header1: header1, ); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - /// Test serialization of outer boolean types /// /// Note: This method returns the HTTP [Response]. diff --git a/samples/openapi3/client/petstore/python-legacy/README.md b/samples/openapi3/client/petstore/python-legacy/README.md index bee1d84445ef..5bd55a79d92a 100755 --- a/samples/openapi3/client/petstore/python-legacy/README.md +++ b/samples/openapi3/client/petstore/python-legacy/README.md @@ -46,7 +46,7 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function -import datetime + import time import petstore_api from petstore_api.rest import ApiException @@ -84,7 +84,6 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | *FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -213,10 +212,6 @@ Class | Method | HTTP request | Description - **Type**: Bearer authentication (JWT) -## http_signature_test - - - ## Author diff --git a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md index f8396a5d1f9d..11be14416407 100755 --- a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -79,133 +78,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **fake_http_signature_test** -> fake_http_signature_test(pet, query_1=query_1, header_1=header_1) - -test http signature authentication - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP message signature: http_signature_test -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See petstore_api.signing for a list of all supported parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, - signed_headers = [ - petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -query_1 = 'query_1_example' # str | query parameter (optional) -header_1 = 'header_1_example' # str | header parameter (optional) - - try: - # test http signature authentication - api_instance.fake_http_signature_test(pet, query_1=query_1, header_1=header_1) - except ApiException as e: - print("Exception when calling FakeApi->fake_http_signature_test: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query_1** | **str**| query parameter | [optional] - **header_1** | **str**| header parameter | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | The instance started successfully | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **fake_outer_boolean_serialize** > bool fake_outer_boolean_serialize(body=body) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py index bb41ebddd78d..436e2105d685 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py @@ -161,157 +161,6 @@ def fake_health_get_with_http_info(self, **kwargs): # noqa: E501 collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth')) - def fake_http_signature_test(self, pet, **kwargs): # noqa: E501 - """test http signature authentication # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_http_signature_test(pet, async_req=True) - >>> result = thread.get() - - :param pet: Pet object that needs to be added to the store (required) - :type pet: Pet - :param query_1: query parameter - :type query_1: str - :param header_1: header parameter - :type header_1: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.fake_http_signature_test_with_http_info(pet, **kwargs) # noqa: E501 - - def fake_http_signature_test_with_http_info(self, pet, **kwargs): # noqa: E501 - """test http signature authentication # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_http_signature_test_with_http_info(pet, async_req=True) - >>> result = thread.get() - - :param pet: Pet object that needs to be added to the store (required) - :type pet: Pet - :param query_1: query parameter - :type query_1: str - :param header_1: header parameter - :type header_1: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pet', - 'query_1', - 'header_1' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_http_signature_test" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet' is set - if self.api_client.client_side_validation and local_var_params.get('pet') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet` when calling `fake_http_signature_test`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('query_1') is not None: # noqa: E501 - query_params.append(('query_1', local_var_params['query_1'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - if 'header_1' in local_var_params: - header_params['header_1'] = local_var_params['header_1'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'pet' in local_var_params: - body_params = local_var_params['pet'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/xml'], - 'GET', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['http_signature_test'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/http-signature-test', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 """fake_outer_boolean_serialize # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/configuration.py index 50ce149ab7de..b663e8cfe28a 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/configuration.py @@ -69,8 +69,6 @@ class Configuration(object): disabled. This can be useful to troubleshoot data validation problem, such as when the OpenAPI document validation rules do not match the actual API data received by the server. - :param signing_info: Configuration parameters for the HTTP signature security scheme. - Must be an instance of petstore_api.signing.HttpSigningConfiguration :param server_index: Index to servers configuration. :param server_variables: Mapping with string values to replace variables in templated server configuration. The validation of enums is performed for @@ -119,45 +117,6 @@ class Configuration(object): password='the-password', ) - - HTTP Signature Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: signature - - Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, - sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time - of the signature to 5 minutes after the signature has been created. - Note you can use the constants defined in the petstore_api.signing module, and you can - also specify arbitrary HTTP headers to be included in the HTTP signature, except for the - 'Authorization' header, which is used to carry the signature. - - One may be tempted to sign all headers by default, but in practice it rarely works. - This is because explicit proxies, transparent proxies, TLS termination endpoints or - load balancers may add/modify/remove headers. Include the HTTP headers that you know - are not going to be modified in transit. - -conf = petstore_api.Configuration( - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_RSASSA_PSS, - signed_headers = [petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) """ _default = None @@ -167,7 +126,6 @@ def __init__(self, host=None, username=None, password=None, discard_unknown_keys=False, disabled_client_side_validations="", - signing_info=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, ssl_ca_cert=None, @@ -210,11 +168,6 @@ def __init__(self, host=None, """ self.discard_unknown_keys = discard_unknown_keys self.disabled_client_side_validations = disabled_client_side_validations - if signing_info is not None: - signing_info.host = host - self.signing_info = signing_info - """The HTTP signing configuration - """ self.access_token = None """access token for OAuth/Bearer """ @@ -307,10 +260,6 @@ def __setattr__(self, name, value): raise ApiValueError( "Invalid keyword: '{0}''".format(v)) self._disabled_client_side_validations = s - if name == "signing_info" and value is not None: - # Ensure the host parameter from signing info is the same as - # Configuration.host. - value.host = self.host @classmethod def set_default(cls, default): @@ -500,13 +449,6 @@ def auth_settings(self): 'key': 'Authorization', 'value': 'Bearer ' + self.access_token } - if self.signing_info is not None: - auth['http_signature_test'] = { - 'type': 'http-signature', - 'in': 'header', - 'key': 'Authorization', - 'value': None # Signature headers are calculated for every HTTP request - } return auth def to_debug_report(self): diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.cpp b/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.cpp index bcdca0dcdafb..cc13f3fa8a55 100644 --- a/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.cpp +++ b/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.cpp @@ -225,123 +225,6 @@ std::string FakeHealthResource::extractFormParamsFromBody(const std::string& par } return ""; } -FakeHttp_signature_testResource::FakeHttp_signature_testResource(const std::string& context /* = "/v2" */) -{ - this->set_path(context + "/fake/http-signature-test"); - this->set_method_handler("GET", - std::bind(&FakeHttp_signature_testResource::handler_GET_internal, this, - std::placeholders::_1)); -} - -std::pair FakeHttp_signature_testResource::handleFakeApiException(const FakeApiException& e) -{ - return std::make_pair(e.getStatus(), e.what()); -} - -std::pair FakeHttp_signature_testResource::handleStdException(const std::exception& e) -{ - return std::make_pair(500, e.what()); -} - -std::pair FakeHttp_signature_testResource::handleUnspecifiedException() -{ - return std::make_pair(500, "Unknown exception occurred"); -} - -void FakeHttp_signature_testResource::setResponseHeader(const std::shared_ptr& session, const std::string& header) -{ - session->set_header(header, ""); -} - -void FakeHttp_signature_testResource::returnResponse(const std::shared_ptr& session, const int status, const std::string& result, std::multimap& responseHeaders) -{ - responseHeaders.insert(std::make_pair("Connection", "close")); - session->close(status, result, responseHeaders); -} - -void FakeHttp_signature_testResource::defaultSessionClose(const std::shared_ptr& session, const int status, const std::string& result) -{ - session->close(status, result, { {"Connection", "close"} }); -} - -void FakeHttp_signature_testResource::handler_GET_internal(const std::shared_ptr session) -{ - const auto request = session->get_request(); - // body params or form params here from the body content string - std::string bodyContent = extractBodyContent(session); - auto pet = extractJsonModelBodyParam(bodyContent); - // Getting the query params - std::string query1 = request->get_query_parameter("query1", ""); - // Getting the headers - std::string header1 = request->get_header("header_1", ""); - - int status_code = 500; - std::string result = ""; - - try { - status_code = - handler_GET(pet, query1, header1); - } - catch(const FakeApiException& e) { - std::tie(status_code, result) = handleFakeApiException(e); - } - catch(const std::exception& e) { - std::tie(status_code, result) = handleStdException(e); - } - catch(...) { - std::tie(status_code, result) = handleUnspecifiedException(); - } - - std::multimap< std::string, std::string > responseHeaders {}; - static const std::vector contentTypes{ - "application/json" - }; - static const std::string acceptTypes{ - "application/json, application/xml, " - }; - - if (status_code == 200) { - responseHeaders.insert(std::make_pair("Content-Type", selectPreferredContentType(contentTypes))); - if (!acceptTypes.empty()) { - responseHeaders.insert(std::make_pair("Accept", acceptTypes)); - } - - returnResponse(session, 200, result.empty() ? "{}" : result, responseHeaders); - return; - } - defaultSessionClose(session, status_code, result); -} - - -int FakeHttp_signature_testResource::handler_GET( - Pet & pet, std::string & query1, std::string & header1) -{ - return handler_GET_func(pet, query1, header1); -} - - -std::string FakeHttp_signature_testResource::extractBodyContent(const std::shared_ptr& session) { - const auto request = session->get_request(); - int content_length = request->get_header("Content-Length", 0); - std::string bodyContent; - session->fetch(content_length, - [&bodyContent](const std::shared_ptr session, - const restbed::Bytes &body) { - bodyContent = restbed::String::format( - "%.*s\n", (int)body.size(), body.data()); - }); - return bodyContent; -} - -std::string FakeHttp_signature_testResource::extractFormParamsFromBody(const std::string& paramName, const std::string& body) { - const auto uri = restbed::Uri("urlencoded?" + body, true); - const auto params = uri.get_query_parameters(); - const auto result = params.find(paramName); - if (result != params.cend()) { - return result->second; - } - return ""; -} FakeOuterBooleanResource::FakeOuterBooleanResource(const std::string& context /* = "/v2" */) { this->set_path(context + "/fake/outer/boolean"); @@ -1951,12 +1834,6 @@ std::shared_ptr FakeApi::getFakeHealthReso } return m_spFakeHealthResource; } -std::shared_ptr FakeApi::getFakeHttp_signature_testResource() { - if (!m_spFakeHttp_signature_testResource) { - setResource(std::make_shared()); - } - return m_spFakeHttp_signature_testResource; -} std::shared_ptr FakeApi::getFakeOuterBooleanResource() { if (!m_spFakeOuterBooleanResource) { setResource(std::make_shared()); @@ -2033,10 +1910,6 @@ void FakeApi::setResource(std::shared_ptr m_spFakeHealthResource = resource; m_service->publish(m_spFakeHealthResource); } -void FakeApi::setResource(std::shared_ptr resource) { - m_spFakeHttp_signature_testResource = resource; - m_service->publish(m_spFakeHttp_signature_testResource); -} void FakeApi::setResource(std::shared_ptr resource) { m_spFakeOuterBooleanResource = resource; m_service->publish(m_spFakeOuterBooleanResource); @@ -2089,10 +1962,6 @@ void FakeApi::setFakeApiFakeHealthResource(std::shared_ptrpublish(m_spFakeHealthResource); } -void FakeApi::setFakeApiFakeHttp_signature_testResource(std::shared_ptr spFakeHttp_signature_testResource) { - m_spFakeHttp_signature_testResource = spFakeHttp_signature_testResource; - m_service->publish(m_spFakeHttp_signature_testResource); -} void FakeApi::setFakeApiFakeOuterBooleanResource(std::shared_ptr spFakeOuterBooleanResource) { m_spFakeOuterBooleanResource = spFakeOuterBooleanResource; m_service->publish(m_spFakeOuterBooleanResource); @@ -2147,9 +2016,6 @@ void FakeApi::publishDefaultResources() { if (!m_spFakeHealthResource) { setResource(std::make_shared()); } - if (!m_spFakeHttp_signature_testResource) { - setResource(std::make_shared()); - } if (!m_spFakeOuterBooleanResource) { setResource(std::make_shared()); } diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.h b/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.h index 9e18249ae297..c2d0e1559b11 100644 --- a/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.h +++ b/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.h @@ -37,7 +37,6 @@ #include "HealthCheckResult.h" #include "OuterComposite.h" #include "OuterObjectWithEnumProperty.h" -#include "Pet.h" #include "User.h" #include #include @@ -104,68 +103,6 @@ class FakeHealthResource: public restbed::Resource ); -protected: - ////////////////////////////////////// - // Override these for customization // - ////////////////////////////////////// - - virtual std::string extractBodyContent(const std::shared_ptr& session); - virtual std::string extractFormParamsFromBody(const std::string& paramName, const std::string& body); - - virtual std::pair handleFakeApiException(const FakeApiException& e); - virtual std::pair handleStdException(const std::exception& e); - virtual std::pair handleUnspecifiedException(); - - virtual void setResponseHeader(const std::shared_ptr& session, - const std::string& header); - - virtual void returnResponse(const std::shared_ptr& session, - const int status, const std::string& result, std::multimap& contentType); - virtual void defaultSessionClose(const std::shared_ptr& session, - const int status, const std::string& result); - -private: - void handler_GET_internal(const std::shared_ptr session); -}; - -/// -/// test http signature authentication -/// -/// -/// -/// -class FakeHttp_signature_testResource: public restbed::Resource -{ -public: - FakeHttp_signature_testResource(const std::string& context = "/v2"); - virtual ~FakeHttp_signature_testResource() = default; - - FakeHttp_signature_testResource( - const FakeHttp_signature_testResource& other) = default; // copy constructor - FakeHttp_signature_testResource(FakeHttp_signature_testResource&& other) noexcept = default; // move constructor - - FakeHttp_signature_testResource& operator=(const FakeHttp_signature_testResource& other) = default; // copy assignment - FakeHttp_signature_testResource& operator=(FakeHttp_signature_testResource&& other) noexcept = default; // move assignment - - ///////////////////////////////////////////////////// - // Set these to implement the server functionality // - ///////////////////////////////////////////////////// - std::function handler_GET_func = - [](Pet &, std::string &, std::string &) -> int - { throw FakeApiException(501, "Not implemented"); }; - - -protected: - ////////////////////////////////////////////////////////// - // As an alternative to setting the `std::function`s // - // override these to implement the server functionality // - ////////////////////////////////////////////////////////// - - virtual int handler_GET( - Pet & pet, std::string & query1, std::string & header1); - - protected: ////////////////////////////////////// // Override these for customization // @@ -961,7 +898,6 @@ class FakeTest_query_parametersResource: public restbed::Resource } /* namespace FakeApiResources */ using FakeApiFakeHealthResource [[deprecated]] = FakeApiResources::FakeHealthResource; -using FakeApiFakeHttp_signature_testResource [[deprecated]] = FakeApiResources::FakeHttp_signature_testResource; using FakeApiFakeOuterBooleanResource [[deprecated]] = FakeApiResources::FakeOuterBooleanResource; using FakeApiFakeOuterCompositeResource [[deprecated]] = FakeApiResources::FakeOuterCompositeResource; using FakeApiFakeOuterNumberResource [[deprecated]] = FakeApiResources::FakeOuterNumberResource; @@ -985,7 +921,6 @@ class FakeApi virtual ~FakeApi(); std::shared_ptr getFakeHealthResource(); - std::shared_ptr getFakeHttp_signature_testResource(); std::shared_ptr getFakeOuterBooleanResource(); std::shared_ptr getFakeOuterCompositeResource(); std::shared_ptr getFakeOuterNumberResource(); @@ -1000,7 +935,6 @@ class FakeApi std::shared_ptr getFakeTest_query_parametersResource(); void setResource(std::shared_ptr resource); - void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); @@ -1016,8 +950,6 @@ class FakeApi [[deprecated("use setResource()")]] virtual void setFakeApiFakeHealthResource(std::shared_ptr spFakeApiFakeHealthResource); [[deprecated("use setResource()")]] - virtual void setFakeApiFakeHttp_signature_testResource(std::shared_ptr spFakeApiFakeHttp_signature_testResource); - [[deprecated("use setResource()")]] virtual void setFakeApiFakeOuterBooleanResource(std::shared_ptr spFakeApiFakeOuterBooleanResource); [[deprecated("use setResource()")]] virtual void setFakeApiFakeOuterCompositeResource(std::shared_ptr spFakeApiFakeOuterCompositeResource); @@ -1048,7 +980,6 @@ class FakeApi protected: std::shared_ptr m_spFakeHealthResource; - std::shared_ptr m_spFakeHttp_signature_testResource; std::shared_ptr m_spFakeOuterBooleanResource; std::shared_ptr m_spFakeOuterCompositeResource; std::shared_ptr m_spFakeOuterNumberResource; diff --git a/samples/server/petstore/java-helidon-server/mp/README.md b/samples/server/petstore/java-helidon-server/mp/README.md index 582fc1c98ebe..26705f7fcaf8 100644 --- a/samples/server/petstore/java-helidon-server/mp/README.md +++ b/samples/server/petstore/java-helidon-server/mp/README.md @@ -14,7 +14,6 @@ java -jar target/petstore-helidon-server-mp.jar curl -X PATCH http://petstore.swagger.io:80/v2 curl -X GET http://petstore.swagger.io:80/v2 curl -X GET http://petstore.swagger.io:80/v2/health -curl -X GET http://petstore.swagger.io:80/v2/http-signature-test curl -X POST http://petstore.swagger.io:80/v2/outer/boolean curl -X POST http://petstore.swagger.io:80/v2/outer/composite curl -X POST http://petstore.swagger.io:80/v2/outer/number diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java index 130451d090fc..93996a4d4171 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; -import org.openapitools.server.model.Pet; import org.openapitools.server.model.User; import jakarta.ws.rs.*; @@ -43,11 +42,6 @@ public interface FakeService { @Produces({ "application/json" }) HealthCheckResult fakeHealthGet(); - @GET - @Path("/http-signature-test") - @Consumes({ "application/json", "application/xml" }) - void fakeHttpSignatureTest(@Valid @NotNull Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1); - @POST @Path("/outer/boolean") @Consumes({ "application/json" }) diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java index d0e402393b12..2eeb01d5ca85 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; -import org.openapitools.server.model.Pet; import org.openapitools.server.model.User; import jakarta.ws.rs.*; @@ -47,12 +46,6 @@ public HealthCheckResult fakeHealthGet() { return result; } - @GET - @Path("/http-signature-test") - @Consumes({ "application/json", "application/xml" }) - public void fakeHttpSignatureTest(@Valid @NotNull Pet pet,@QueryParam("query_1") String query1,@HeaderParam("header_1") String header1) { - } - @POST @Path("/outer/boolean") @Consumes({ "application/json" }) diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml index 5c0bc517dac5..1b071eeae99a 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml @@ -1218,38 +1218,6 @@ paths: tags: - fake x-accepts: application/json - /fake/http-signature-test: - get: - operationId: fake-http-signature-test - parameters: - - description: query parameter - explode: true - in: query - name: query_1 - required: false - schema: - type: string - style: form - - description: header parameter - explode: false - in: header - name: header_1 - required: false - schema: - type: string - style: simple - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "200": - description: The instance started successfully - security: - - http_signature_test: [] - summary: test http signature authentication - tags: - - fake - x-content-type: application/json - x-accepts: application/json components: requestBodies: UserArray: @@ -2167,6 +2135,3 @@ components: bearerFormat: JWT scheme: bearer type: http - http_signature_test: - scheme: signature - type: http diff --git a/samples/server/petstore/java-helidon-server/se/README.md b/samples/server/petstore/java-helidon-server/se/README.md index ed9e99d3ae5e..edc502506f6f 100644 --- a/samples/server/petstore/java-helidon-server/se/README.md +++ b/samples/server/petstore/java-helidon-server/se/README.md @@ -14,7 +14,6 @@ java -jar target/petstore-helidon-server-se.jar curl -X PATCH http://petstore.swagger.io:80/v2/another-fake/dummy curl -X GET http://petstore.swagger.io:80/v2/foo curl -X GET http://petstore.swagger.io:80/v2/fake/health -curl -X GET http://petstore.swagger.io:80/v2/fake/http-signature-test curl -X POST http://petstore.swagger.io:80/v2/fake/outer/boolean curl -X POST http://petstore.swagger.io:80/v2/fake/outer/composite curl -X POST http://petstore.swagger.io:80/v2/fake/outer/number diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java index 3ab5d3796535..67e55a492600 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java @@ -13,7 +13,6 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; -import org.openapitools.server.model.Pet; import org.openapitools.server.model.User; import io.helidon.webserver.Routing; @@ -30,7 +29,6 @@ public interface FakeService extends Service { @Override default void update(Routing.Rules rules) { rules.get("/fake/health", this::fakeHealthGet); - rules.get("/fake/http-signature-test", Handler.create(Pet.class, this::fakeHttpSignatureTest)); rules.post("/fake/outer/boolean", this::fakeOuterBooleanSerialize); rules.post("/fake/outer/composite", Handler.create(OuterComposite.class, this::fakeOuterCompositeSerialize)); rules.post("/fake/outer/number", this::fakeOuterNumberSerialize); @@ -56,14 +54,6 @@ default void update(Routing.Rules rules) { */ void fakeHealthGet(ServerRequest request, ServerResponse response); - /** - * GET /fake/http-signature-test : test http signature authentication. - * @param request the server request - * @param response the server response - * @param pet Pet object that needs to be added to the store - */ - void fakeHttpSignatureTest(ServerRequest request, ServerResponse response, Pet pet); - /** * POST /fake/outer/boolean. * @param request the server request diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java index 8dbc1c125aef..0dd3bbf090c3 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -13,7 +13,6 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; -import org.openapitools.server.model.Pet; import org.openapitools.server.model.User; import java.util.logging.Logger; @@ -31,10 +30,6 @@ public void fakeHealthGet(ServerRequest request, ServerResponse response) { response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); } - public void fakeHttpSignatureTest(ServerRequest request, ServerResponse response, Pet pet) { - response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); - } - public void fakeOuterBooleanSerialize(ServerRequest request, ServerResponse response) { response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); } diff --git a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml index 5c0bc517dac5..1b071eeae99a 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml @@ -1218,38 +1218,6 @@ paths: tags: - fake x-accepts: application/json - /fake/http-signature-test: - get: - operationId: fake-http-signature-test - parameters: - - description: query parameter - explode: true - in: query - name: query_1 - required: false - schema: - type: string - style: form - - description: header parameter - explode: false - in: header - name: header_1 - required: false - schema: - type: string - style: simple - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "200": - description: The instance started successfully - security: - - http_signature_test: [] - summary: test http signature authentication - tags: - - fake - x-content-type: application/json - x-accepts: application/json components: requestBodies: UserArray: @@ -2167,6 +2135,3 @@ components: bearerFormat: JWT scheme: bearer type: http - http_signature_test: - scheme: signature - type: http diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java index 1d5924839331..15de85ef0d03 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java @@ -17,7 +17,6 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.OuterObjectWithEnumProperty; -import org.openapitools.model.Pet; import org.openapitools.model.User; import java.util.Map; @@ -78,20 +77,6 @@ public Response fakeHealthGet(@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeHealthGet(securityContext); } - @javax.ws.rs.GET - @Path("/http-signature-test") - @Consumes({ "application/json", "application/xml" }) - - @io.swagger.annotations.ApiOperation(value = "test http signature authentication", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "http_signature_test") - }, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "The instance started successfully", response = Void.class) - }) - public Response fakeHttpSignatureTest(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet pet,@ApiParam(value = "query parameter") @QueryParam("query_1") String query1,@ApiParam(value = "header parameter" )@HeaderParam("header_1") String header1,@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.fakeHttpSignatureTest(pet, query1, header1, securityContext); - } @javax.ws.rs.POST @Path("/outer/boolean") @Consumes({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java index 46be025f281c..f6df9b4c178d 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java @@ -15,7 +15,6 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.OuterObjectWithEnumProperty; -import org.openapitools.model.Pet; import org.openapitools.model.User; import java.util.List; @@ -29,7 +28,6 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen") public abstract class FakeApiService { public abstract Response fakeHealthGet(SecurityContext securityContext) throws NotFoundException; - public abstract Response fakeHttpSignatureTest(Pet pet,String query1,String header1,SecurityContext securityContext) throws NotFoundException; public abstract Response fakeOuterBooleanSerialize(Boolean body,SecurityContext securityContext) throws NotFoundException; public abstract Response fakeOuterCompositeSerialize(OuterComposite outerComposite,SecurityContext securityContext) throws NotFoundException; public abstract Response fakeOuterNumberSerialize(BigDecimal body,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 543ff24f31e4..dbd154f06163 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -12,7 +12,6 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.OuterObjectWithEnumProperty; -import org.openapitools.model.Pet; import org.openapitools.model.User; import java.util.List; @@ -33,11 +32,6 @@ public Response fakeHealthGet(SecurityContext securityContext) throws NotFoundEx return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response fakeHttpSignatureTest(Pet pet, String query1, String header1, SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - @Override public Response fakeOuterBooleanSerialize(Boolean body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php index ed45b3a38e12..b3f253509c5b 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php @@ -326,34 +326,6 @@ public function fakeHealthGet() return response('How about implementing fakeHealthGet as a get method ?'); } - /** - * Operation fakeHttpSignatureTest - * - * test http signature authentication. - * - * - * @return Http response - */ - public function fakeHttpSignatureTest() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['pet'])) { - throw new \InvalidArgumentException('Missing the required parameter $pet when calling fakeHttpSignatureTest'); - } - $pet = $input['pet']; - - $query1 = $input['query1']; - - $header1 = $input['header1']; - - - return response('How about implementing fakeHttpSignatureTest as a get method ?'); - } /** * Operation testInlineAdditionalProperties * diff --git a/samples/server/petstore/php-laravel/lib/routes/api.php b/samples/server/petstore/php-laravel/lib/routes/api.php index ca0e27d2241d..2747adcaf5fc 100644 --- a/samples/server/petstore/php-laravel/lib/routes/api.php +++ b/samples/server/petstore/php-laravel/lib/routes/api.php @@ -91,13 +91,6 @@ * Output-Formats: [application/json] */ Route::get('/v2/fake/health', 'FakeController@fakeHealthGet'); -/** - * get fakeHttpSignatureTest - * Summary: test http signature authentication - * Notes: - - */ -Route::get('/v2/fake/http-signature-test', 'FakeController@fakeHttpSignatureTest'); /** * post testInlineAdditionalProperties * Summary: test inline additionalProperties diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php index 875d25c866cb..44c47a7ac47c 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php @@ -322,34 +322,6 @@ public function fakeHealthGet() return response('How about implementing fakeHealthGet as a get method ?'); } - /** - * Operation fakeHttpSignatureTest - * - * test http signature authentication. - * - * - * @return Http response - */ - public function fakeHttpSignatureTest() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['pet'])) { - throw new \InvalidArgumentException('Missing the required parameter $pet when calling fakeHttpSignatureTest'); - } - $pet = $input['pet']; - - $query_1 = $input['query_1']; - - $header_1 = $input['header_1']; - - - return response('How about implementing fakeHttpSignatureTest as a get method ?'); - } /** * Operation testInlineAdditionalProperties * diff --git a/samples/server/petstore/php-lumen/lib/routes/web.php b/samples/server/petstore/php-lumen/lib/routes/web.php index 8e987b516596..a5126e8531f4 100644 --- a/samples/server/petstore/php-lumen/lib/routes/web.php +++ b/samples/server/petstore/php-lumen/lib/routes/web.php @@ -107,13 +107,6 @@ */ $router->get('/v2/fake/health', 'FakeApi@fakeHealthGet'); -/** - * get fakeHttpSignatureTest - * Summary: test http signature authentication - * Notes: - */ -$router->get('/v2/fake/http-signature-test', 'FakeApi@fakeHttpSignatureTest'); - /** * post testInlineAdditionalProperties * Summary: test inline additionalProperties From 5a79c387e8c70087e74ef9cbf567f32d6df1dfda Mon Sep 17 00:00:00 2001 From: Tiffany Marrel Date: Thu, 13 Apr 2023 16:57:16 +0200 Subject: [PATCH 5/5] test behavior in case of unsupported http scheme defined in openapi.yaml document --- ...ith-fake-endpoints-models-for-testing.yaml | 29 ++ .../petstore/csharp/OpenAPIClient/README.md | 5 + .../csharp/OpenAPIClient/docs/FakeApi.md | 79 ++++++ .../src/Org.OpenAPITools/Api/FakeApi.cs | 215 +++++++++++++++ .../elixir/lib/openapi_petstore/api/fake.ex | 38 +++ .../java-helidon-client/mp/docs/FakeApi.md | 36 +++ .../org/openapitools/client/api/FakeApi.java | 9 + .../java-helidon-client/se/docs/FakeApi.md | 70 +++++ .../org/openapitools/client/api/FakeApi.java | 10 + .../openapitools/client/api/FakeApiImpl.java | 53 ++++ .../petstore/java/apache-httpclient/README.md | 6 + .../java/apache-httpclient/api/openapi.yaml | 35 +++ .../java/apache-httpclient/docs/FakeApi.md | 70 +++++ .../org/openapitools/client/api/FakeApi.java | 79 ++++++ .../petstore/java/feign/api/openapi.yaml | 35 +++ .../org/openapitools/client/ApiClient.java | 2 + .../org/openapitools/client/api/FakeApi.java | 90 ++++++ .../petstore/java/webclient-jakarta/README.md | 6 + .../java/webclient-jakarta/api/openapi.yaml | 35 +++ .../java/webclient-jakarta/docs/FakeApi.md | 70 +++++ .../org/openapitools/client/api/FakeApi.java | 82 ++++++ .../client/petstore/java/webclient/README.md | 6 + .../petstore/java/webclient/api/openapi.yaml | 35 +++ .../petstore/java/webclient/docs/FakeApi.md | 70 +++++ .../org/openapitools/client/api/FakeApi.java | 82 ++++++ samples/client/petstore/k6/script.js | 18 ++ samples/client/petstore/perl/README.md | 5 + samples/client/petstore/perl/docs/FakeApi.md | 51 ++++ .../perl/lib/WWW/OpenAPIClient/ApiClient.pm | 2 + .../perl/lib/WWW/OpenAPIClient/FakeApi.pm | 83 ++++++ .../petstore/php/OpenAPIClient-php/README.md | 4 + .../php/OpenAPIClient-php/docs/Api/FakeApi.md | 60 ++++ .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 257 ++++++++++++++++++ .../client/petstore/ruby-autoload/README.md | 4 + .../petstore/ruby-autoload/docs/FakeApi.md | 71 +++++ .../lib/petstore/api/fake_api.rb | 70 +++++ .../client/petstore/ruby-faraday/README.md | 4 + .../petstore/ruby-faraday/docs/FakeApi.md | 71 +++++ .../ruby-faraday/lib/petstore/api/fake_api.rb | 70 +++++ samples/client/petstore/ruby/README.md | 4 + samples/client/petstore/ruby/docs/FakeApi.md | 71 +++++ .../ruby/lib/petstore/api/fake_api.rb | 70 +++++ .../builds/default-v3.0/apis/FakeApi.ts | 49 ++++ .../README.md | 5 + .../doc/FakeApi.md | 48 ++++ .../lib/src/api/fake_api.dart | 83 ++++++ .../petstore_client_lib_fake/README.md | 5 + .../petstore_client_lib_fake/doc/FakeApi.md | 48 ++++ .../lib/src/api/fake_api.dart | 85 ++++++ .../dart2/petstore_client_lib_fake/README.md | 4 + .../petstore_client_lib_fake/doc/FakeApi.md | 45 +++ .../lib/api/fake_api.dart | 66 +++++ .../client/petstore/python-legacy/README.md | 5 + .../petstore/python-legacy/docs/FakeApi.md | 68 +++++ .../petstore_api/api/fake_api.py | 151 ++++++++++ .../cpp-restbed/generated/3_0/api/FakeApi.cpp | 134 +++++++++ .../cpp-restbed/generated/3_0/api/FakeApi.h | 69 +++++ .../petstore/java-helidon-server/mp/README.md | 1 + .../openapitools/server/api/FakeService.java | 6 + .../server/api/FakeServiceImpl.java | 7 + .../src/main/resources/META-INF/openapi.yml | 35 +++ .../petstore/java-helidon-server/se/README.md | 1 + .../openapitools/server/api/FakeService.java | 10 + .../server/api/FakeServiceImpl.java | 5 + .../src/main/resources/META-INF/openapi.yml | 35 +++ .../java/org/openapitools/api/FakeApi.java | 15 + .../org/openapitools/api/FakeApiService.java | 2 + .../api/impl/FakeApiServiceImpl.java | 6 + .../app/Http/Controllers/FakeController.php | 28 ++ .../petstore/php-laravel/lib/routes/api.php | 7 + .../lib/app/Http/Controllers/FakeApi.php | 28 ++ .../petstore/php-lumen/lib/routes/web.php | 7 + 72 files changed, 3220 insertions(+) diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index dae7d1a42423..8d78ba07d543 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1185,6 +1185,32 @@ paths: application/json: schema: $ref: '#/components/schemas/HealthCheckResult' + /fake/unsupported-scheme-test: + get: + tags: + - fake + summary: test behavior with unsupported http scheme only + operationId: fake-unsupported-scheme-test + parameters: + - name: query_1 + in: query + description: query parameter + required: optional + schema: + type: string + - name: header_1 + in: header + description: header parameter + required: optional + schema: + type: string + security: + - unsupported_test: [] + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + 200: + description: The instance started successfully servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server @@ -1262,6 +1288,9 @@ components: type: http scheme: bearer bearerFormat: JWT + unsupported_test: + type: http + scheme: foobar schemas: Foo: type: object diff --git a/samples/client/petstore/csharp/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md index 191888b99d8a..91762568fa46 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient/README.md @@ -113,6 +113,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | *FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | *FakeApi* | [**FakePropertyEnumIntegerSerialize**](docs/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +*FakeApi* | [**FakeUnsupportedSchemeTest**](docs/FakeApi.md#fakeunsupportedschemetest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only *FakeApi* | [**TestBodyWithBinary**](docs/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | *FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -240,3 +241,7 @@ Class | Method | HTTP request | Description - **Type**: HTTP bearer authentication + +### unsupported_test + + diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index 65a64380db61..fcfaf6be99fe 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -10,6 +10,7 @@ Method | HTTP request | Description [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | [**FakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[**FakeUnsupportedSchemeTest**](FakeApi.md#fakeunsupportedschemetest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only [**TestBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -468,6 +469,84 @@ No authorization required [[Back to README]](../README.md) +## FakeUnsupportedSchemeTest + +> void FakeUnsupportedSchemeTest (Pet pet, string query1 = null, string header1 = null) + +test behavior with unsupported http scheme only + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeUnsupportedSchemeTestExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + + var apiInstance = new FakeApi(Configuration.Default); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + var query1 = "query1_example"; // string | query parameter (optional) + var header1 = "header1_example"; // string | header parameter (optional) + + try + { + // test behavior with unsupported http scheme only + apiInstance.FakeUnsupportedSchemeTest(pet, query1, header1); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeUnsupportedSchemeTest: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **string**| query parameter | [optional] + **header1** | **string**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## TestBodyWithBinary > void TestBodyWithBinary (System.IO.Stream body) diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 9631431c6b0d..8fbaaea37b3e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -150,6 +150,31 @@ public interface IFakeApi : IApiAccessor /// ApiResponse of OuterObjectWithEnumProperty ApiResponse FakePropertyEnumIntegerSerializeWithHttpInfo (OuterObjectWithEnumProperty outerObjectWithEnumProperty); /// + /// test behavior with unsupported http scheme only + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// + void FakeUnsupportedSchemeTest (Pet pet, string query1 = default(string), string header1 = default(string)); + + /// + /// test behavior with unsupported http scheme only + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// ApiResponse of Object(void) + ApiResponse FakeUnsupportedSchemeTestWithHttpInfo (Pet pet, string query1 = default(string), string header1 = default(string)); + /// /// /// /// @@ -566,6 +591,33 @@ public interface IFakeApi : IApiAccessor /// Task of ApiResponse (OuterObjectWithEnumProperty) System.Threading.Tasks.Task> FakePropertyEnumIntegerSerializeWithHttpInfoAsync (OuterObjectWithEnumProperty outerObjectWithEnumProperty, CancellationToken cancellationToken = default(CancellationToken)); /// + /// test behavior with unsupported http scheme only + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// Cancellation Token to cancel request (optional) + /// Task of void + System.Threading.Tasks.Task FakeUnsupportedSchemeTestAsync (Pet pet, string query1 = default(string), string header1 = default(string), CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// test behavior with unsupported http scheme only + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// Cancellation Token to cancel request (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> FakeUnsupportedSchemeTestWithHttpInfoAsync (Pet pet, string query1 = default(string), string header1 = default(string), CancellationToken cancellationToken = default(CancellationToken)); + /// /// /// /// @@ -1828,6 +1880,169 @@ public ApiResponse FakePropertyEnumIntegerSerialize (OuterObjectWithEnumProperty) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterObjectWithEnumProperty))); } + /// + /// test behavior with unsupported http scheme only + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// + public void FakeUnsupportedSchemeTest (Pet pet, string query1 = default(string), string header1 = default(string)) + { + FakeUnsupportedSchemeTestWithHttpInfo(pet, query1, header1); + } + + /// + /// test behavior with unsupported http scheme only + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// ApiResponse of Object(void) + public ApiResponse FakeUnsupportedSchemeTestWithHttpInfo (Pet pet, string query1 = default(string), string header1 = default(string)) + { + // verify the required parameter 'pet' is set + if (pet == null) + throw new ApiException(400, "Missing required parameter 'pet' when calling FakeApi->FakeUnsupportedSchemeTest"); + + var localVarPath = "/fake/unsupported-scheme-test"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (query1 != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query_1", query1)); // query parameter + if (header1 != null) localVarHeaderParams.Add("header_1", this.Configuration.ApiClient.ParameterToString(header1)); // header parameter + if (pet != null && pet.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter + } + else + { + localVarPostBody = pet; // byte array + } + + // authentication (unsupported_test) required + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeUnsupportedSchemeTest", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// test behavior with unsupported http scheme only + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// Cancellation Token to cancel request (optional) + /// Task of void + public async System.Threading.Tasks.Task FakeUnsupportedSchemeTestAsync (Pet pet, string query1 = default(string), string header1 = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + await FakeUnsupportedSchemeTestWithHttpInfoAsync(pet, query1, header1, cancellationToken); + + } + + /// + /// test behavior with unsupported http scheme only + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// Cancellation Token to cancel request (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> FakeUnsupportedSchemeTestWithHttpInfoAsync (Pet pet, string query1 = default(string), string header1 = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + // verify the required parameter 'pet' is set + if (pet == null) + throw new ApiException(400, "Missing required parameter 'pet' when calling FakeApi->FakeUnsupportedSchemeTest"); + + var localVarPath = "/fake/unsupported-scheme-test"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (query1 != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query_1", query1)); // query parameter + if (header1 != null) localVarHeaderParams.Add("header_1", this.Configuration.ApiClient.ParameterToString(header1)); // header parameter + if (pet != null && pet.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter + } + else + { + localVarPostBody = pet; // byte array + } + + // authentication (unsupported_test) required + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, cancellationToken); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeUnsupportedSchemeTest", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + /// /// For this test, the body has to be a binary file. /// diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex index 8a1bcae0e1f2..34510ba837d1 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex @@ -207,6 +207,44 @@ defmodule OpenapiPetstore.Api.Fake do ]) end + @doc """ + test behavior with unsupported http scheme only + + ### Parameters + + - `connection` (OpenapiPetstore.Connection): Connection to server + - `pet` (Pet): Pet object that needs to be added to the store + - `opts` (keyword): Optional parameters + - `:query_1` (String.t): query parameter + - `:header_1` (String.t): header parameter + + ### Returns + + - `{:ok, nil}` on success + - `{:error, Tesla.Env.t}` on failure + """ + @spec fake_unsupported_scheme_test(Tesla.Env.client, OpenapiPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def fake_unsupported_scheme_test(connection, pet, opts \\ []) do + optional_params = %{ + :query_1 => :query, + :header_1 => :headers + } + + request = + %{} + |> method(:get) + |> url("/fake/unsupported-scheme-test") + |> add_param(:body, :body, pet) + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + + connection + |> Connection.request(request) + |> evaluate_response([ + {200, false} + ]) + end + @doc """ For this test, the body has to be a binary file. diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md b/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md index 1ca0aa87e83d..6489a39a51d6 100644 --- a/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md +++ b/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md @@ -10,6 +10,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | | [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**fakeUnsupportedSchemeTest**](FakeApi.md#fakeUnsupportedSchemeTest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only | | [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | | [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | | [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | @@ -228,6 +229,41 @@ No authorization required | **200** | Output enum (int) | - | +## fakeUnsupportedSchemeTest + +> void fakeUnsupportedSchemeTest(pet, query1, header1) + +test behavior with unsupported http scheme only + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + ## testBodyWithBinary > void testBodyWithBinary(body) diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java index 562123c1e59a..a9537331cc42 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java @@ -35,6 +35,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; /** @@ -85,6 +86,14 @@ public interface FakeApi { @Produces({ "*/*" }) OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws ApiException, ProcessingException; + /** + * test behavior with unsupported http scheme only + */ + @GET + @Path("/unsupported-scheme-test") + @Consumes({ "application/json", "application/xml" }) + void fakeUnsupportedSchemeTest(Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1) throws ApiException, ProcessingException; + @PUT @Path("/body-with-binary") @Consumes({ "image/png" }) diff --git a/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md b/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md index 224d4e56b587..5d4ff9183470 100644 --- a/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md +++ b/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md @@ -10,6 +10,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | | [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**fakeUnsupportedSchemeTest**](FakeApi.md#fakeUnsupportedSchemeTest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only | | [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | | [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | | [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | @@ -413,6 +414,75 @@ No authorization required | **200** | Output enum (int) | - | +## fakeUnsupportedSchemeTest + +> fakeUnsupportedSchemeTest(pet, query1, header1) + +test behavior with unsupported http scheme only + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + FakeApi apiInstance = new FakeApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + String query1 = "query1_example"; // String | query parameter + String header1 = "header1_example"; // String | header parameter + try { + apiInstance.fakeUnsupportedSchemeTest(pet, query1, header1); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeUnsupportedSchemeTest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + ## testBodyWithBinary > testBodyWithBinary(body) diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java index 121995f54618..5d8d8ee4fcda 100644 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java @@ -25,6 +25,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; /** @@ -50,6 +51,15 @@ public interface FakeApi { ApiResponse fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty); + /** + * test behavior with unsupported http scheme only + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @return {@code ApiResponse} + */ + ApiResponse fakeUnsupportedSchemeTest(Pet pet, String query1, String header1); + ApiResponse testBodyWithBinary(File body); ApiResponse testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass); diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java index 1d78620df14e..bb268efd93d2 100644 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -41,6 +41,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; import java.util.ArrayList; import org.openapitools.client.Pair; @@ -62,6 +63,7 @@ public class FakeApiImpl implements FakeApi { protected static final GenericType RESPONSE_TYPE_fakeOuterNumberSerialize = ResponseType.create(BigDecimal.class); protected static final GenericType RESPONSE_TYPE_fakeOuterStringSerialize = ResponseType.create(String.class); protected static final GenericType RESPONSE_TYPE_fakePropertyEnumIntegerSerialize = ResponseType.create(OuterObjectWithEnumProperty.class); + protected static final GenericType RESPONSE_TYPE_fakeUnsupportedSchemeTest = ResponseType.create(Void.class); protected static final GenericType RESPONSE_TYPE_testBodyWithBinary = ResponseType.create(Void.class); protected static final GenericType RESPONSE_TYPE_testBodyWithFileSchema = ResponseType.create(Void.class); protected static final GenericType RESPONSE_TYPE_testBodyWithQueryParams = ResponseType.create(Void.class); @@ -305,6 +307,57 @@ protected ApiResponse fakePropertyEnumIntegerSerial return ApiResponse.create(RESPONSE_TYPE_fakePropertyEnumIntegerSerialize, webClientResponse); } + @Override + public ApiResponse fakeUnsupportedSchemeTest(Pet pet, String query1, String header1) { + Objects.requireNonNull(pet, "Required parameter 'pet' not specified"); + WebClientRequestBuilder webClientRequestBuilder = fakeUnsupportedSchemeTestRequestBuilder(pet, query1, header1); + return fakeUnsupportedSchemeTestSubmit(webClientRequestBuilder, pet, query1, header1); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the fakeUnsupportedSchemeTest operation. + * Optional customization point for subclasses. + * + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @return WebClientRequestBuilder for fakeUnsupportedSchemeTest + */ + protected WebClientRequestBuilder fakeUnsupportedSchemeTestRequestBuilder(Pet pet, String query1, String header1) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + List queryParams = new ArrayList<>(); + queryParams.addAll(ApiClient.parameterToPairs("query_1", query1)); + queryParams.forEach(p -> webClientRequestBuilder.queryParam(p.getName(), p.getValue())); + + WebClientRequestHeaders headers = webClientRequestBuilder.headers(); + if (header1 != null) { + headers.put("header_1", header1); + } + + webClientRequestBuilder.path("/fake/unsupported-scheme-test"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the fakeUnsupportedSchemeTest operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse fakeUnsupportedSchemeTestSubmit(WebClientRequestBuilder webClientRequestBuilder, Pet pet, String query1, String header1) { + Single webClientResponse = webClientRequestBuilder.submit(pet); + return ApiResponse.create(RESPONSE_TYPE_fakeUnsupportedSchemeTest, webClientResponse); + } + @Override public ApiResponse testBodyWithBinary(File body) { Objects.requireNonNull(body, "Required parameter 'body' not specified"); diff --git a/samples/client/petstore/java/apache-httpclient/README.md b/samples/client/petstore/java/apache-httpclient/README.md index 008c0894e2c8..e96a3452256a 100644 --- a/samples/client/petstore/java/apache-httpclient/README.md +++ b/samples/client/petstore/java/apache-httpclient/README.md @@ -114,6 +114,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | *FakeApi* | [**fakePropertyEnumIntegerSerialize**](docs/FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | +*FakeApi* | [**fakeUnsupportedSchemeTest**](docs/FakeApi.md#fakeUnsupportedSchemeTest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only *FakeApi* | [**testBodyWithBinary**](docs/FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | *FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | @@ -235,6 +236,11 @@ Authentication schemes defined for the API: ### bearer_test +- **Type**: HTTP basic authentication + +### unsupported_test + + - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml index f098d240cd20..0349af2ce801 100644 --- a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml +++ b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml @@ -1218,6 +1218,38 @@ paths: tags: - fake x-accepts: application/json + /fake/unsupported-scheme-test: + get: + operationId: fake-unsupported-scheme-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - unsupported_test: [] + summary: test behavior with unsupported http scheme only + tags: + - fake + x-content-type: application/json + x-accepts: application/json components: requestBodies: UserArray: @@ -2135,4 +2167,7 @@ components: bearerFormat: JWT scheme: bearer type: http + unsupported_test: + scheme: foobar + type: http diff --git a/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md b/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md index 224d4e56b587..5d4ff9183470 100644 --- a/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md +++ b/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md @@ -10,6 +10,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | | [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**fakeUnsupportedSchemeTest**](FakeApi.md#fakeUnsupportedSchemeTest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only | | [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | | [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | | [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | @@ -413,6 +414,75 @@ No authorization required | **200** | Output enum (int) | - | +## fakeUnsupportedSchemeTest + +> fakeUnsupportedSchemeTest(pet, query1, header1) + +test behavior with unsupported http scheme only + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + FakeApi apiInstance = new FakeApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + String query1 = "query1_example"; // String | query parameter + String header1 = "header1_example"; // String | header parameter + try { + apiInstance.fakeUnsupportedSchemeTest(pet, query1, header1); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeUnsupportedSchemeTest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + ## testBodyWithBinary > testBodyWithBinary(body) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java index eae7e81b8af4..30a5f128fcd4 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -30,6 +30,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; @@ -479,6 +480,84 @@ public OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(OuterObjectW ); } + /** + * test behavior with unsupported http scheme only + * + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @throws ApiException if fails to make API call + */ + public void fakeUnsupportedSchemeTest(Pet pet, String query1, String header1) throws ApiException { + this.fakeUnsupportedSchemeTest(pet, query1, header1, Collections.emptyMap()); + } + + + /** + * test behavior with unsupported http scheme only + * + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void fakeUnsupportedSchemeTest(Pet pet, String query1, String header1, Map additionalHeaders) throws ApiException { + Object localVarPostBody = pet; + + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling fakeUnsupportedSchemeTest"); + } + + // create path and map variables + String localVarPath = "/fake/unsupported-scheme-test"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("query_1", query1)); + if (header1 != null) + localVarHeaderParams.put("header_1", apiClient.parameterToString(header1)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "unsupported_test" }; + + apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + /** * * For this test, the body has to be a binary file. diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index f098d240cd20..0349af2ce801 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -1218,6 +1218,38 @@ paths: tags: - fake x-accepts: application/json + /fake/unsupported-scheme-test: + get: + operationId: fake-unsupported-scheme-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - unsupported_test: [] + summary: test behavior with unsupported http scheme only + tags: + - fake + x-content-type: application/json + x-accepts: application/json components: requestBodies: UserArray: @@ -2135,4 +2167,7 @@ components: bearerFormat: JWT scheme: bearer type: http + unsupported_test: + scheme: foobar + type: http diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java index 74947f7c1572..951fd15ce7ef 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java @@ -69,6 +69,8 @@ public ApiClient(String[] authNames) { auth = new HttpBasicAuth(); } else if ("bearer_test".equals(authName)) { auth = new HttpBearerAuth("bearer"); + } else if ("unsupported_test".equals(authName)) { + throw new RuntimeException("auth name \"" + authName + "\" is not a supported basic auth type"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java index d5a40ef65455..362130a8a114 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java @@ -14,6 +14,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; import java.util.ArrayList; @@ -196,6 +197,95 @@ public interface FakeApi extends ApiClient.Api { + /** + * test behavior with unsupported http scheme only + * + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + */ + @RequestLine("GET /fake/unsupported-scheme-test?query_1={query1}") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + "header_1: {header1}" + }) + void fakeUnsupportedSchemeTest(Pet pet, @Param("query1") String query1, @Param("header1") String header1); + + /** + * test behavior with unsupported http scheme only + * Similar to fakeUnsupportedSchemeTest but it also returns the http response headers . + * + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + */ + @RequestLine("GET /fake/unsupported-scheme-test?query_1={query1}") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + "header_1: {header1}" + }) + ApiResponse fakeUnsupportedSchemeTestWithHttpInfo(Pet pet, @Param("query1") String query1, @Param("header1") String header1); + + + /** + * test behavior with unsupported http scheme only + * + * Note, this is equivalent to the other fakeUnsupportedSchemeTest method, + * but with the query parameters collected into a single Map parameter. This + * is convenient for services with optional query parameters, especially when + * used with the {@link FakeUnsupportedSchemeTestQueryParams} class that allows for + * building up this map in a fluent style. + * @param pet Pet object that needs to be added to the store (required) + * @param header1 header parameter (optional) + * @param queryParams Map of query parameters as name-value pairs + *

The following elements may be specified in the query map:

+ *
    + *
  • query1 - query parameter (optional)
  • + *
+ */ + @RequestLine("GET /fake/unsupported-scheme-test?query_1={query1}") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + "header_1: {header1}" + }) + void fakeUnsupportedSchemeTest(Pet pet, @Param("header1") String header1, @QueryMap(encoded=true) FakeUnsupportedSchemeTestQueryParams queryParams); + + /** + * test behavior with unsupported http scheme only + * + * Note, this is equivalent to the other fakeUnsupportedSchemeTest that receives the query parameters as a map, + * but this one also exposes the Http response headers + * @param pet Pet object that needs to be added to the store (required) + * @param header1 header parameter (optional) + * @param queryParams Map of query parameters as name-value pairs + *

The following elements may be specified in the query map:

+ *
    + *
  • query1 - query parameter (optional)
  • + *
+ */ + @RequestLine("GET /fake/unsupported-scheme-test?query_1={query1}") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + "header_1: {header1}" + }) + ApiResponse fakeUnsupportedSchemeTestWithHttpInfo(Pet pet, @Param("header1") String header1, @QueryMap(encoded=true) FakeUnsupportedSchemeTestQueryParams queryParams); + + + /** + * A convenience class for generating query parameters for the + * fakeUnsupportedSchemeTest method in a fluent style. + */ + public static class FakeUnsupportedSchemeTestQueryParams extends HashMap { + public FakeUnsupportedSchemeTestQueryParams query1(final String value) { + put("query_1", EncodingUtils.encode(value)); + return this; + } + } + /** * * For this test, the body has to be a binary file. diff --git a/samples/client/petstore/java/webclient-jakarta/README.md b/samples/client/petstore/java/webclient-jakarta/README.md index 67186042bca5..46483c9c07fb 100644 --- a/samples/client/petstore/java/webclient-jakarta/README.md +++ b/samples/client/petstore/java/webclient-jakarta/README.md @@ -121,6 +121,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | *FakeApi* | [**fakePropertyEnumIntegerSerialize**](docs/FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | +*FakeApi* | [**fakeUnsupportedSchemeTest**](docs/FakeApi.md#fakeUnsupportedSchemeTest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only *FakeApi* | [**testBodyWithBinary**](docs/FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | *FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | @@ -242,6 +243,11 @@ Authentication schemes defined for the API: ### bearer_test +- **Type**: HTTP basic authentication + +### unsupported_test + + - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml index f098d240cd20..0349af2ce801 100644 --- a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml @@ -1218,6 +1218,38 @@ paths: tags: - fake x-accepts: application/json + /fake/unsupported-scheme-test: + get: + operationId: fake-unsupported-scheme-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - unsupported_test: [] + summary: test behavior with unsupported http scheme only + tags: + - fake + x-content-type: application/json + x-accepts: application/json components: requestBodies: UserArray: @@ -2135,4 +2167,7 @@ components: bearerFormat: JWT scheme: bearer type: http + unsupported_test: + scheme: foobar + type: http diff --git a/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md b/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md index 224d4e56b587..5d4ff9183470 100644 --- a/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md @@ -10,6 +10,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | | [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**fakeUnsupportedSchemeTest**](FakeApi.md#fakeUnsupportedSchemeTest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only | | [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | | [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | | [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | @@ -413,6 +414,75 @@ No authorization required | **200** | Output enum (int) | - | +## fakeUnsupportedSchemeTest + +> fakeUnsupportedSchemeTest(pet, query1, header1) + +test behavior with unsupported http scheme only + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + FakeApi apiInstance = new FakeApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + String query1 = "query1_example"; // String | query parameter + String header1 = "header1_example"; // String | header parameter + try { + apiInstance.fakeUnsupportedSchemeTest(pet, query1, header1); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeUnsupportedSchemeTest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + ## testBodyWithBinary > testBodyWithBinary(body) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/api/FakeApi.java index c0474abd7eef..11035e54e817 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/api/FakeApi.java @@ -12,6 +12,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; import java.util.HashMap; @@ -474,6 +475,87 @@ public Mono> fakePropertyEnumInteger public ResponseSpec fakePropertyEnumIntegerSerializeWithResponseSpec(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws WebClientResponseException { return fakePropertyEnumIntegerSerializeRequestCreation(outerObjectWithEnumProperty); } + /** + * test behavior with unsupported http scheme only + * + *

200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeUnsupportedSchemeTestRequestCreation(Pet pet, String query1, String header1) throws WebClientResponseException { + Object postBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + throw new WebClientResponseException("Missing the required parameter 'pet' when calling fakeUnsupportedSchemeTest", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query_1", query1)); + + if (header1 != null) + headerParams.add("header_1", apiClient.parameterToString(header1)); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "unsupported_test" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/unsupported-scheme-test", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test behavior with unsupported http scheme only + * + *

200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono fakeUnsupportedSchemeTest(Pet pet, String query1, String header1) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return fakeUnsupportedSchemeTestRequestCreation(pet, query1, header1).bodyToMono(localVarReturnType); + } + + /** + * test behavior with unsupported http scheme only + * + *

200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> fakeUnsupportedSchemeTestWithHttpInfo(Pet pet, String query1, String header1) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return fakeUnsupportedSchemeTestRequestCreation(pet, query1, header1).toEntity(localVarReturnType); + } + + /** + * test behavior with unsupported http scheme only + * + *

200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeUnsupportedSchemeTestWithResponseSpec(Pet pet, String query1, String header1) throws WebClientResponseException { + return fakeUnsupportedSchemeTestRequestCreation(pet, query1, header1); + } /** * * For this test, the body has to be a binary file. diff --git a/samples/client/petstore/java/webclient/README.md b/samples/client/petstore/java/webclient/README.md index 67186042bca5..46483c9c07fb 100644 --- a/samples/client/petstore/java/webclient/README.md +++ b/samples/client/petstore/java/webclient/README.md @@ -121,6 +121,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | *FakeApi* | [**fakePropertyEnumIntegerSerialize**](docs/FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | +*FakeApi* | [**fakeUnsupportedSchemeTest**](docs/FakeApi.md#fakeUnsupportedSchemeTest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only *FakeApi* | [**testBodyWithBinary**](docs/FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | *FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | @@ -242,6 +243,11 @@ Authentication schemes defined for the API: ### bearer_test +- **Type**: HTTP basic authentication + +### unsupported_test + + - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index f098d240cd20..0349af2ce801 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -1218,6 +1218,38 @@ paths: tags: - fake x-accepts: application/json + /fake/unsupported-scheme-test: + get: + operationId: fake-unsupported-scheme-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - unsupported_test: [] + summary: test behavior with unsupported http scheme only + tags: + - fake + x-content-type: application/json + x-accepts: application/json components: requestBodies: UserArray: @@ -2135,4 +2167,7 @@ components: bearerFormat: JWT scheme: bearer type: http + unsupported_test: + scheme: foobar + type: http diff --git a/samples/client/petstore/java/webclient/docs/FakeApi.md b/samples/client/petstore/java/webclient/docs/FakeApi.md index 224d4e56b587..5d4ff9183470 100644 --- a/samples/client/petstore/java/webclient/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient/docs/FakeApi.md @@ -10,6 +10,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | | [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**fakeUnsupportedSchemeTest**](FakeApi.md#fakeUnsupportedSchemeTest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only | | [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | | [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | | [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | @@ -413,6 +414,75 @@ No authorization required | **200** | Output enum (int) | - | +## fakeUnsupportedSchemeTest + +> fakeUnsupportedSchemeTest(pet, query1, header1) + +test behavior with unsupported http scheme only + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + FakeApi apiInstance = new FakeApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + String query1 = "query1_example"; // String | query parameter + String header1 = "header1_example"; // String | header parameter + try { + apiInstance.fakeUnsupportedSchemeTest(pet, query1, header1); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeUnsupportedSchemeTest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + ## testBodyWithBinary > testBodyWithBinary(body) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index 0e8d76df7462..2191f3bdb7c3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -12,6 +12,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; import java.util.HashMap; @@ -474,6 +475,87 @@ public Mono> fakePropertyEnumInteger public ResponseSpec fakePropertyEnumIntegerSerializeWithResponseSpec(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws WebClientResponseException { return fakePropertyEnumIntegerSerializeRequestCreation(outerObjectWithEnumProperty); } + /** + * test behavior with unsupported http scheme only + * + *

200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeUnsupportedSchemeTestRequestCreation(Pet pet, String query1, String header1) throws WebClientResponseException { + Object postBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + throw new WebClientResponseException("Missing the required parameter 'pet' when calling fakeUnsupportedSchemeTest", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query_1", query1)); + + if (header1 != null) + headerParams.add("header_1", apiClient.parameterToString(header1)); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "unsupported_test" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/unsupported-scheme-test", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test behavior with unsupported http scheme only + * + *

200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono fakeUnsupportedSchemeTest(Pet pet, String query1, String header1) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return fakeUnsupportedSchemeTestRequestCreation(pet, query1, header1).bodyToMono(localVarReturnType); + } + + /** + * test behavior with unsupported http scheme only + * + *

200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> fakeUnsupportedSchemeTestWithHttpInfo(Pet pet, String query1, String header1) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return fakeUnsupportedSchemeTestRequestCreation(pet, query1, header1).toEntity(localVarReturnType); + } + + /** + * test behavior with unsupported http scheme only + * + *

200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeUnsupportedSchemeTestWithResponseSpec(Pet pet, String query1, String header1) throws WebClientResponseException { + return fakeUnsupportedSchemeTestRequestCreation(pet, query1, header1); + } /** * * For this test, the body has to be a binary file. diff --git a/samples/client/petstore/k6/script.js b/samples/client/petstore/k6/script.js index 8e523ef01319..c2b5765a78e1 100644 --- a/samples/client/petstore/k6/script.js +++ b/samples/client/petstore/k6/script.js @@ -20,6 +20,7 @@ const BASE_URL = "https://127.0.0.1/no_varaible"; const SLEEP_DURATION = 0.1; // Global variables should be initialized. let booleanGroup = "TODO_EDIT_THE_BOOLEAN_GROUP"; +let header1 = "TODO_EDIT_THE_HEADER_1"; let apiKey = "TODO_EDIT_THE_API_KEY"; let requiredBooleanGroup = "TODO_EDIT_THE_REQUIRED_BOOLEAN_GROUP"; let enumHeaderStringArray = "TODO_EDIT_THE_ENUM_HEADER_STRING_ARRAY"; @@ -278,6 +279,23 @@ export default function() { } }); + group("/fake/unsupported-scheme-test", () => { + let query1 = 'TODO_EDIT_THE_QUERY_1'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1: fake-unsupported-scheme-test + { + let url = BASE_URL + `/fake/unsupported-scheme-test?query_1=${query_1}`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "set", "tags": "list", "status": "string"}; + let params = {headers: {"Content-Type": "application/json", "header_1": `${header1}`, "Accept": "application/json"}}; + let request = http.get(url, JSON.stringify(body), params); + + check(request, { + "The instance started successfully": (r) => r.status === 200 + }); + } + }); + group("/pet/{petId}", () => { let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index e0a73c8057b3..34d8ef3c60c5 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -392,6 +392,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | *FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | *FakeApi* | [**fake_property_enum_integer_serialize**](docs/FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | +*FakeApi* | [**fake_unsupported_scheme_test**](docs/FakeApi.md#fake_unsupported_scheme_test) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only *FakeApi* | [**test_body_with_binary**](docs/FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | *FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | @@ -508,3 +509,7 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication +## unsupported_test + +- **Type**: HTTP basic authentication + diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index 734d7de7e0d3..eb4ef593eb5c 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -15,6 +15,7 @@ Method | HTTP request | Description [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | [**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | [**fake_property_enum_integer_serialize**](FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | +[**fake_unsupported_scheme_test**](FakeApi.md#fake_unsupported_scheme_test) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only [**test_body_with_binary**](FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | [**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | @@ -297,6 +298,56 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **fake_unsupported_scheme_test** +> fake_unsupported_scheme_test(pet => $pet, query_1 => $query_1, header_1 => $header_1) + +test behavior with unsupported http scheme only + +### Example +```perl +use Data::Dumper; +use WWW::OpenAPIClient::FakeApi; +my $api_instance = WWW::OpenAPIClient::FakeApi->new( + + # Configure HTTP basic authorization: unsupported_test + +); + +my $pet = WWW::OpenAPIClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store +my $query_1 = "query_1_example"; # string | query parameter +my $header_1 = "header_1_example"; # string | header parameter + +eval { + $api_instance->fake_unsupported_scheme_test(pet => $pet, query_1 => $query_1, header_1 => $header_1); +}; +if ($@) { + warn "Exception when calling FakeApi->fake_unsupported_scheme_test: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query_1** | **string**| query parameter | [optional] + **header_1** | **string**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_body_with_binary** > test_body_with_binary(body => $body) diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/ApiClient.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/ApiClient.pm index b76d30c5c5b2..e0c56b6d1583 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/ApiClient.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/ApiClient.pm @@ -369,6 +369,8 @@ sub update_params_for_auth { $header_params->{'Authorization'} = 'Bearer ' . $self->{config}{access_token}; } } + elsif ($auth eq 'unsupported_test') { + } else { # TODO show warning about security definition not found } diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm index f93529f9294b..9e367898a5b9 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm @@ -402,6 +402,89 @@ sub fake_property_enum_integer_serialize { return $_response_object; } +# +# fake_unsupported_scheme_test +# +# test behavior with unsupported http scheme only +# +# @param Pet $pet Pet object that needs to be added to the store (required) +# @param string $query_1 query parameter (optional) +# @param string $header_1 header parameter (optional) +{ + my $params = { + 'pet' => { + data_type => 'Pet', + description => 'Pet object that needs to be added to the store', + required => '1', + }, + 'query_1' => { + data_type => 'string', + description => 'query parameter', + required => '0', + }, + 'header_1' => { + data_type => 'string', + description => 'header parameter', + required => '0', + }, + }; + __PACKAGE__->method_documentation->{ 'fake_unsupported_scheme_test' } = { + summary => 'test behavior with unsupported http scheme only', + params => $params, + returns => undef, + }; +} +# @return void +# +sub fake_unsupported_scheme_test { + my ($self, %args) = @_; + + # verify the required parameter 'pet' is set + unless (exists $args{'pet'}) { + croak("Missing the required parameter 'pet' when calling fake_unsupported_scheme_test"); + } + + # parse inputs + my $_resource_path = '/fake/unsupported-scheme-test'; + + my $_method = 'GET'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept(); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', 'application/xml'); + + # query params + if ( exists $args{'query_1'}) { + $query_params->{'query_1'} = $self->{api_client}->to_query_value($args{'query_1'}); + } + + # header params + if ( exists $args{'header_1'}) { + $header_params->{'header_1'} = $self->{api_client}->to_header_value($args{'header_1'}); + } + + my $_body_data; + # body params + if ( exists $args{'pet'}) { + $_body_data = $args{'pet'}; + } + + # authentication setting, if any + my $auth_settings = [qw(unsupported_test )]; + + # make the API Call + $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + return; +} + # # test_body_with_binary # diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index 42f351970f8c..9d34d8927732 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -80,6 +80,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/Api/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | *FakeApi* | [**fakePropertyEnumIntegerSerialize**](docs/Api/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +*FakeApi* | [**fakeUnsupportedSchemeTest**](docs/Api/FakeApi.md#fakeunsupportedschemetest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only *FakeApi* | [**testBodyWithBinary**](docs/Api/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | *FakeApi* | [**testBodyWithFileSchema**](docs/Api/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**testBodyWithQueryParams**](docs/Api/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -201,6 +202,9 @@ Class | Method | HTTP request | Description - **Type**: Bearer authentication (JWT) + +### unsupported_test + ## Tests To run the tests, use: diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md index 77afcc34937d..5e0daa5fb4d4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -10,6 +10,7 @@ All URIs are relative to http://petstore.swagger.io:80/v2, except if the operati | [**fakeOuterNumberSerialize()**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | | [**fakeOuterStringSerialize()**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | | [**fakePropertyEnumIntegerSerialize()**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**fakeUnsupportedSchemeTest()**](FakeApi.md#fakeUnsupportedSchemeTest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only | | [**testBodyWithBinary()**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | | [**testBodyWithFileSchema()**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | | [**testBodyWithQueryParams()**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | @@ -353,6 +354,65 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fakeUnsupportedSchemeTest()` + +```php +fakeUnsupportedSchemeTest($pet, $query_1, $header_1) +``` + +test behavior with unsupported http scheme only + +### Example + +```php +fakeUnsupportedSchemeTest($pet, $query_1, $header_1); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->fakeUnsupportedSchemeTest: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | | +| **query_1** | **string**| query parameter | [optional] | +| **header_1** | **string**| header parameter | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[unsupported_test](../../README.md#unsupported_test) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `testBodyWithBinary()` ```php diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 6ab4d288a752..6b74043c7252 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -89,6 +89,10 @@ class FakeApi 'fakePropertyEnumIntegerSerialize' => [ 'application/json', ], + 'fakeUnsupportedSchemeTest' => [ + 'application/json', + 'application/xml', + ], 'testBodyWithBinary' => [ 'image/png', ], @@ -1776,6 +1780,259 @@ public function fakePropertyEnumIntegerSerializeRequest($outer_object_with_enum_ ); } + /** + * Operation fakeUnsupportedSchemeTest + * + * test behavior with unsupported http scheme only + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeUnsupportedSchemeTest'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function fakeUnsupportedSchemeTest($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeUnsupportedSchemeTest'][0]) + { + $this->fakeUnsupportedSchemeTestWithHttpInfo($pet, $query_1, $header_1, $contentType); + } + + /** + * Operation fakeUnsupportedSchemeTestWithHttpInfo + * + * test behavior with unsupported http scheme only + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeUnsupportedSchemeTest'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function fakeUnsupportedSchemeTestWithHttpInfo($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeUnsupportedSchemeTest'][0]) + { + $request = $this->fakeUnsupportedSchemeTestRequest($pet, $query_1, $header_1, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation fakeUnsupportedSchemeTestAsync + * + * test behavior with unsupported http scheme only + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeUnsupportedSchemeTest'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fakeUnsupportedSchemeTestAsync($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeUnsupportedSchemeTest'][0]) + { + return $this->fakeUnsupportedSchemeTestAsyncWithHttpInfo($pet, $query_1, $header_1, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation fakeUnsupportedSchemeTestAsyncWithHttpInfo + * + * test behavior with unsupported http scheme only + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeUnsupportedSchemeTest'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fakeUnsupportedSchemeTestAsyncWithHttpInfo($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeUnsupportedSchemeTest'][0]) + { + $returnType = ''; + $request = $this->fakeUnsupportedSchemeTestRequest($pet, $query_1, $header_1, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'fakeUnsupportedSchemeTest' + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeUnsupportedSchemeTest'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function fakeUnsupportedSchemeTestRequest($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeUnsupportedSchemeTest'][0]) + { + + // verify the required parameter 'pet' is set + if ($pet === null || (is_array($pet) && count($pet) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $pet when calling fakeUnsupportedSchemeTest' + ); + } + + + + + $resourcePath = '/fake/unsupported-scheme-test'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $query_1, + 'query_1', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($header_1 !== null) { + $headerParams['header_1'] = ObjectSerializer::toHeaderValue($header_1); + } + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($pet)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pet)); + } else { + $httpBody = $pet; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation testBodyWithBinary * diff --git a/samples/client/petstore/ruby-autoload/README.md b/samples/client/petstore/ruby-autoload/README.md index 12e8bf340d1e..fda5295d99ae 100644 --- a/samples/client/petstore/ruby-autoload/README.md +++ b/samples/client/petstore/ruby-autoload/README.md @@ -83,6 +83,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | *Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | *Petstore::FakeApi* | [**fake_property_enum_integer_serialize**](docs/FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | +*Petstore::FakeApi* | [**fake_unsupported_scheme_test**](docs/FakeApi.md#fake_unsupported_scheme_test) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only *Petstore::FakeApi* | [**test_body_with_binary**](docs/FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | *Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | *Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | @@ -204,3 +205,6 @@ Class | Method | HTTP request | Description - **Type**: Bearer authentication (JWT) +### unsupported_test + + diff --git a/samples/client/petstore/ruby-autoload/docs/FakeApi.md b/samples/client/petstore/ruby-autoload/docs/FakeApi.md index e2a1a0195f84..819dd566b2ce 100644 --- a/samples/client/petstore/ruby-autoload/docs/FakeApi.md +++ b/samples/client/petstore/ruby-autoload/docs/FakeApi.md @@ -10,6 +10,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | | | [**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | | | [**fake_property_enum_integer_serialize**](FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | | +| [**fake_unsupported_scheme_test**](FakeApi.md#fake_unsupported_scheme_test) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only | | [**test_body_with_binary**](FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | | | [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | | | [**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | | @@ -409,6 +410,76 @@ No authorization required - **Accept**: */* +## fake_unsupported_scheme_test + +> fake_unsupported_scheme_test(pet, opts) + +test behavior with unsupported http scheme only + +### Examples + +```ruby +require 'time' +require 'petstore' +# setup authorization +Petstore.configure do |config| +end + +api_instance = Petstore::FakeApi.new +pet = Petstore::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store +opts = { + query_1: 'query_1_example', # String | query parameter + header_1: 'header_1_example' # String | header parameter +} + +begin + # test behavior with unsupported http scheme only + api_instance.fake_unsupported_scheme_test(pet, opts) +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->fake_unsupported_scheme_test: #{e}" +end +``` + +#### Using the fake_unsupported_scheme_test_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> fake_unsupported_scheme_test_with_http_info(pet, opts) + +```ruby +begin + # test behavior with unsupported http scheme only + data, status_code, headers = api_instance.fake_unsupported_scheme_test_with_http_info(pet, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->fake_unsupported_scheme_test_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | +| **query_1** | **String** | query parameter | [optional] | +| **header_1** | **String** | header parameter | [optional] | + +### Return type + +nil (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + ## test_body_with_binary > test_body_with_binary(body) diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb index 433d394c0d44..d9cc0605a130 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb @@ -388,6 +388,76 @@ def fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_p return data, status_code, headers end + # test behavior with unsupported http scheme only + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter + # @return [nil] + def fake_unsupported_scheme_test(pet, opts = {}) + fake_unsupported_scheme_test_with_http_info(pet, opts) + nil + end + + # test behavior with unsupported http scheme only + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def fake_unsupported_scheme_test_with_http_info(pet, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_unsupported_scheme_test ...' + end + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_unsupported_scheme_test" + end + # resource path + local_var_path = '/fake/unsupported-scheme-test' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json', 'application/xml']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + header_params[:'header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(pet) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['unsupported_test'] + + new_options = opts.merge( + :operation => :"FakeApi.fake_unsupported_scheme_test", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_unsupported_scheme_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # For this test, the body has to be a binary file. # @param body [File] image to upload # @param [Hash] opts the optional parameters diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index 12e8bf340d1e..fda5295d99ae 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -83,6 +83,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | *Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | *Petstore::FakeApi* | [**fake_property_enum_integer_serialize**](docs/FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | +*Petstore::FakeApi* | [**fake_unsupported_scheme_test**](docs/FakeApi.md#fake_unsupported_scheme_test) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only *Petstore::FakeApi* | [**test_body_with_binary**](docs/FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | *Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | *Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | @@ -204,3 +205,6 @@ Class | Method | HTTP request | Description - **Type**: Bearer authentication (JWT) +### unsupported_test + + diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index e2a1a0195f84..819dd566b2ce 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -10,6 +10,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | | | [**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | | | [**fake_property_enum_integer_serialize**](FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | | +| [**fake_unsupported_scheme_test**](FakeApi.md#fake_unsupported_scheme_test) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only | | [**test_body_with_binary**](FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | | | [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | | | [**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | | @@ -409,6 +410,76 @@ No authorization required - **Accept**: */* +## fake_unsupported_scheme_test + +> fake_unsupported_scheme_test(pet, opts) + +test behavior with unsupported http scheme only + +### Examples + +```ruby +require 'time' +require 'petstore' +# setup authorization +Petstore.configure do |config| +end + +api_instance = Petstore::FakeApi.new +pet = Petstore::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store +opts = { + query_1: 'query_1_example', # String | query parameter + header_1: 'header_1_example' # String | header parameter +} + +begin + # test behavior with unsupported http scheme only + api_instance.fake_unsupported_scheme_test(pet, opts) +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->fake_unsupported_scheme_test: #{e}" +end +``` + +#### Using the fake_unsupported_scheme_test_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> fake_unsupported_scheme_test_with_http_info(pet, opts) + +```ruby +begin + # test behavior with unsupported http scheme only + data, status_code, headers = api_instance.fake_unsupported_scheme_test_with_http_info(pet, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->fake_unsupported_scheme_test_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | +| **query_1** | **String** | query parameter | [optional] | +| **header_1** | **String** | header parameter | [optional] | + +### Return type + +nil (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + ## test_body_with_binary > test_body_with_binary(body) diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index 433d394c0d44..d9cc0605a130 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -388,6 +388,76 @@ def fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_p return data, status_code, headers end + # test behavior with unsupported http scheme only + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter + # @return [nil] + def fake_unsupported_scheme_test(pet, opts = {}) + fake_unsupported_scheme_test_with_http_info(pet, opts) + nil + end + + # test behavior with unsupported http scheme only + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def fake_unsupported_scheme_test_with_http_info(pet, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_unsupported_scheme_test ...' + end + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_unsupported_scheme_test" + end + # resource path + local_var_path = '/fake/unsupported-scheme-test' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json', 'application/xml']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + header_params[:'header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(pet) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['unsupported_test'] + + new_options = opts.merge( + :operation => :"FakeApi.fake_unsupported_scheme_test", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_unsupported_scheme_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # For this test, the body has to be a binary file. # @param body [File] image to upload # @param [Hash] opts the optional parameters diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 12e8bf340d1e..fda5295d99ae 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -83,6 +83,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | *Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | *Petstore::FakeApi* | [**fake_property_enum_integer_serialize**](docs/FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | +*Petstore::FakeApi* | [**fake_unsupported_scheme_test**](docs/FakeApi.md#fake_unsupported_scheme_test) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only *Petstore::FakeApi* | [**test_body_with_binary**](docs/FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | *Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | *Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | @@ -204,3 +205,6 @@ Class | Method | HTTP request | Description - **Type**: Bearer authentication (JWT) +### unsupported_test + + diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index e2a1a0195f84..819dd566b2ce 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -10,6 +10,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | | | [**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | | | [**fake_property_enum_integer_serialize**](FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | | +| [**fake_unsupported_scheme_test**](FakeApi.md#fake_unsupported_scheme_test) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only | | [**test_body_with_binary**](FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | | | [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | | | [**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | | @@ -409,6 +410,76 @@ No authorization required - **Accept**: */* +## fake_unsupported_scheme_test + +> fake_unsupported_scheme_test(pet, opts) + +test behavior with unsupported http scheme only + +### Examples + +```ruby +require 'time' +require 'petstore' +# setup authorization +Petstore.configure do |config| +end + +api_instance = Petstore::FakeApi.new +pet = Petstore::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store +opts = { + query_1: 'query_1_example', # String | query parameter + header_1: 'header_1_example' # String | header parameter +} + +begin + # test behavior with unsupported http scheme only + api_instance.fake_unsupported_scheme_test(pet, opts) +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->fake_unsupported_scheme_test: #{e}" +end +``` + +#### Using the fake_unsupported_scheme_test_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> fake_unsupported_scheme_test_with_http_info(pet, opts) + +```ruby +begin + # test behavior with unsupported http scheme only + data, status_code, headers = api_instance.fake_unsupported_scheme_test_with_http_info(pet, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->fake_unsupported_scheme_test_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | +| **query_1** | **String** | query parameter | [optional] | +| **header_1** | **String** | header parameter | [optional] | + +### Return type + +nil (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + ## test_body_with_binary > test_body_with_binary(body) diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 433d394c0d44..d9cc0605a130 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -388,6 +388,76 @@ def fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_p return data, status_code, headers end + # test behavior with unsupported http scheme only + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter + # @return [nil] + def fake_unsupported_scheme_test(pet, opts = {}) + fake_unsupported_scheme_test_with_http_info(pet, opts) + nil + end + + # test behavior with unsupported http scheme only + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def fake_unsupported_scheme_test_with_http_info(pet, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_unsupported_scheme_test ...' + end + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_unsupported_scheme_test" + end + # resource path + local_var_path = '/fake/unsupported-scheme-test' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json', 'application/xml']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + header_params[:'header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(pet) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['unsupported_test'] + + new_options = opts.merge( + :operation => :"FakeApi.fake_unsupported_scheme_test", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_unsupported_scheme_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # For this test, the body has to be a binary file. # @param body [File] image to upload # @param [Hash] opts the optional parameters diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts index 3e14991d75dc..a0138861a055 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts @@ -21,6 +21,7 @@ import type { HealthCheckResult, OuterComposite, OuterObjectWithEnumProperty, + Pet, User, } from '../models'; import { @@ -36,6 +37,8 @@ import { OuterCompositeToJSON, OuterObjectWithEnumPropertyFromJSON, OuterObjectWithEnumPropertyToJSON, + PetFromJSON, + PetToJSON, UserFromJSON, UserToJSON, } from '../models'; @@ -60,6 +63,12 @@ export interface FakePropertyEnumIntegerSerializeRequest { outerObjectWithEnumProperty: OuterObjectWithEnumProperty; } +export interface FakeUnsupportedSchemeTestRequest { + pet: Pet; + query1?: string; + header1?: string; +} + export interface TestBodyWithBinaryRequest { body: Blob | null; } @@ -326,6 +335,46 @@ export class FakeApi extends runtime.BaseAPI { return await response.value(); } + /** + * test behavior with unsupported http scheme only + */ + async fakeUnsupportedSchemeTestRaw(requestParameters: FakeUnsupportedSchemeTestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.pet === null || requestParameters.pet === undefined) { + throw new runtime.RequiredError('pet','Required parameter requestParameters.pet was null or undefined when calling fakeUnsupportedSchemeTest.'); + } + + const queryParameters: any = {}; + + if (requestParameters.query1 !== undefined) { + queryParameters['query_1'] = requestParameters.query1; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.header1 !== undefined && requestParameters.header1 !== null) { + headerParameters['header_1'] = String(requestParameters.header1); + } + + const response = await this.request({ + path: `/fake/unsupported-scheme-test`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + body: PetToJSON(requestParameters.pet), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * test behavior with unsupported http scheme only + */ + async fakeUnsupportedSchemeTest(requestParameters: FakeUnsupportedSchemeTestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.fakeUnsupportedSchemeTestRaw(requestParameters, initOverrides); + } + /** * For this test, the body has to be a binary file. */ diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md index 03bdac5a4b33..025ee1eb1569 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md @@ -73,6 +73,7 @@ Class | Method | HTTP request | Description [*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | [*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | [*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[*FakeApi*](doc/FakeApi.md) | [**fakeUnsupportedSchemeTest**](doc/FakeApi.md#fakeunsupportedschemetest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only [*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | [*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -191,6 +192,10 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication +## unsupported_test + +- **Type**: HTTP basic authentication + ## Author diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md index 88334b8402df..7bc061b2c073 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md @@ -15,6 +15,7 @@ Method | HTTP request | Description [**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[**fakeUnsupportedSchemeTest**](FakeApi.md#fakeunsupportedschemetest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only [**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | [**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -279,6 +280,53 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **fakeUnsupportedSchemeTest** +> fakeUnsupportedSchemeTest(pet, query1, header1) + +test behavior with unsupported http scheme only + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure HTTP basic authorization: unsupported_test +//defaultApiClient.getAuthentication('unsupported_test').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('unsupported_test').password = 'YOUR_PASSWORD'; + +final api = Openapi().getFakeApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store +final String query1 = query1_example; // String | query parameter +final String header1 = header1_example; // String | header parameter + +try { + api.fakeUnsupportedSchemeTest(pet, query1, header1); +} catch on DioError (e) { + print('Exception when calling FakeApi->fakeUnsupportedSchemeTest: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **String**| query parameter | [optional] + **header1** | **String**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **testBodyWithBinary** > testBodyWithBinary(body) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart index 531534e89a57..cc14a91929d5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart @@ -15,6 +15,7 @@ import 'package:openapi/src/model/model_client.dart'; import 'package:openapi/src/model/model_enum_class.dart'; import 'package:openapi/src/model/outer_composite.dart'; import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/user.dart'; class FakeApi { @@ -531,6 +532,88 @@ _responseData = deserialize> fakeUnsupportedSchemeTest({ + required Pet pet, + String? query1, + String? header1, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/unsupported-scheme-test'; + final _options = Options( + method: r'GET', + headers: { + if (header1 != null) r'header_1': header1, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'foobar', + 'name': 'unsupported_test', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (query1 != null) r'query_1': query1, + }; + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(pet); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + /// testBodyWithBinary /// For this test, the body has to be a binary file. /// diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md index 2eaf9103aee9..bb04b40412f3 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md @@ -72,6 +72,7 @@ Class | Method | HTTP request | Description [*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | [*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | [*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[*FakeApi*](doc/FakeApi.md) | [**fakeUnsupportedSchemeTest**](doc/FakeApi.md#fakeunsupportedschemetest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only [*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | [*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -190,6 +191,10 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication +## unsupported_test + +- **Type**: HTTP basic authentication + ## Author diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md index 75b02209d6a5..7a88c1130766 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md @@ -15,6 +15,7 @@ Method | HTTP request | Description [**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[**fakeUnsupportedSchemeTest**](FakeApi.md#fakeunsupportedschemetest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only [**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | [**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -279,6 +280,53 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **fakeUnsupportedSchemeTest** +> fakeUnsupportedSchemeTest(pet, query1, header1) + +test behavior with unsupported http scheme only + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure HTTP basic authorization: unsupported_test +//defaultApiClient.getAuthentication('unsupported_test').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('unsupported_test').password = 'YOUR_PASSWORD'; + +final api = Openapi().getFakeApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store +final String query1 = query1_example; // String | query parameter +final String header1 = header1_example; // String | header parameter + +try { + api.fakeUnsupportedSchemeTest(pet, query1, header1); +} catch on DioError (e) { + print('Exception when calling FakeApi->fakeUnsupportedSchemeTest: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **String**| query parameter | [optional] + **header1** | **String**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **testBodyWithBinary** > testBodyWithBinary(body) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart index 41e283862412..f9eb2f09bf31 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart @@ -17,6 +17,7 @@ import 'package:openapi/src/model/model_client.dart'; import 'package:openapi/src/model/model_enum_class.dart'; import 'package:openapi/src/model/outer_composite.dart'; import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/user.dart'; class FakeApi { @@ -560,6 +561,90 @@ class FakeApi { ); } + /// test behavior with unsupported http scheme only + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [query1] - query parameter + /// * [header1] - header parameter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> fakeUnsupportedSchemeTest({ + required Pet pet, + String? query1, + String? header1, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/unsupported-scheme-test'; + final _options = Options( + method: r'GET', + headers: { + if (header1 != null) r'header_1': header1, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'foobar', + 'name': 'unsupported_test', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (query1 != null) r'query_1': encodeQueryParameter(_serializers, query1, const FullType(String)), + }; + + dynamic _bodyData; + + try { + const _type = FullType(Pet); + _bodyData = _serializers.serialize(pet, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + /// testBodyWithBinary /// For this test, the body has to be a binary file. /// diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md index e70f2a5b2b14..bd53fbf88fd4 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md @@ -66,6 +66,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterNumberSerialize**](doc//FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](doc//FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | *FakeApi* | [**fakePropertyEnumIntegerSerialize**](doc//FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +*FakeApi* | [**fakeUnsupportedSchemeTest**](doc//FakeApi.md#fakeunsupportedschemetest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only *FakeApi* | [**testBodyWithBinary**](doc//FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | *FakeApi* | [**testBodyWithFileSchema**](doc//FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**testBodyWithQueryParams**](doc//FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -184,6 +185,9 @@ Class | Method | HTTP request | Description - **Type**: HTTP Bearer authentication +## unsupported_test + + ## Author diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md index 9a8b710668a0..4d3cde0845e0 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md @@ -15,6 +15,7 @@ Method | HTTP request | Description [**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[**fakeUnsupportedSchemeTest**](FakeApi.md#fakeunsupportedschemetest) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only [**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | [**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -279,6 +280,50 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **fakeUnsupportedSchemeTest** +> fakeUnsupportedSchemeTest(pet, query1, header1) + +test behavior with unsupported http scheme only + +### Example +```dart +import 'package:openapi/api.dart'; + +final api_instance = FakeApi(); +final pet = Pet(); // Pet | Pet object that needs to be added to the store +final query1 = query1_example; // String | query parameter +final header1 = header1_example; // String | header parameter + +try { + api_instance.fakeUnsupportedSchemeTest(pet, query1, header1); +} catch (e) { + print('Exception when calling FakeApi->fakeUnsupportedSchemeTest: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **String**| query parameter | [optional] + **header1** | **String**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **testBodyWithBinary** > testBodyWithBinary(body) diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart index bed10db56d58..7e49722fa108 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart @@ -330,6 +330,72 @@ class FakeApi { return null; } + /// test behavior with unsupported http scheme only + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [Pet] pet (required): + /// Pet object that needs to be added to the store + /// + /// * [String] query1: + /// query parameter + /// + /// * [String] header1: + /// header parameter + Future fakeUnsupportedSchemeTestWithHttpInfo(Pet pet, { String? query1, String? header1, }) async { + // ignore: prefer_const_declarations + final path = r'/fake/unsupported-scheme-test'; + + // ignore: prefer_final_locals + Object? postBody = pet; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (query1 != null) { + queryParams.addAll(_queryParams('', 'query_1', query1)); + } + + if (header1 != null) { + headerParams[r'header_1'] = parameterToString(header1); + } + + const contentTypes = ['application/json', 'application/xml']; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// test behavior with unsupported http scheme only + /// + /// Parameters: + /// + /// * [Pet] pet (required): + /// Pet object that needs to be added to the store + /// + /// * [String] query1: + /// query parameter + /// + /// * [String] header1: + /// header parameter + Future fakeUnsupportedSchemeTest(Pet pet, { String? query1, String? header1, }) async { + final response = await fakeUnsupportedSchemeTestWithHttpInfo(pet, query1: query1, header1: header1, ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + } + /// For this test, the body has to be a binary file. /// /// Note: This method returns the HTTP [Response]. diff --git a/samples/openapi3/client/petstore/python-legacy/README.md b/samples/openapi3/client/petstore/python-legacy/README.md index 5bd55a79d92a..58ae835712be 100755 --- a/samples/openapi3/client/petstore/python-legacy/README.md +++ b/samples/openapi3/client/petstore/python-legacy/README.md @@ -89,6 +89,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | *FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | *FakeApi* | [**fake_property_enum_integer_serialize**](docs/FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | +*FakeApi* | [**fake_unsupported_scheme_test**](docs/FakeApi.md#fake_unsupported_scheme_test) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only *FakeApi* | [**test_body_with_binary**](docs/FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | *FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | @@ -212,6 +213,10 @@ Class | Method | HTTP request | Description - **Type**: Bearer authentication (JWT) +## unsupported_test + + + ## Author diff --git a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md index 11be14416407..3031d0a0917d 100755 --- a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md @@ -10,6 +10,7 @@ Method | HTTP request | Description [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | [**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | [**fake_property_enum_integer_serialize**](FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | +[**fake_unsupported_scheme_test**](FakeApi.md#fake_unsupported_scheme_test) | **GET** /fake/unsupported-scheme-test | test behavior with unsupported http scheme only [**test_body_with_binary**](FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | [**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | @@ -383,6 +384,73 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **fake_unsupported_scheme_test** +> fake_unsupported_scheme_test(pet, query_1=query_1, header_1=header_1) + +test behavior with unsupported http scheme only + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store +query_1 = 'query_1_example' # str | query parameter (optional) +header_1 = 'header_1_example' # str | header parameter (optional) + + try: + # test behavior with unsupported http scheme only + api_instance.fake_unsupported_scheme_test(pet, query_1=query_1, header_1=header_1) + except ApiException as e: + print("Exception when calling FakeApi->fake_unsupported_scheme_test: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query_1** | **str**| query parameter | [optional] + **header_1** | **str**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[unsupported_test](../README.md#unsupported_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The instance started successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_body_with_binary** > test_body_with_binary(body) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py index 436e2105d685..11313fc56238 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py @@ -874,6 +874,157 @@ def fake_property_enum_integer_serialize_with_http_info(self, outer_object_with_ collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth')) + def fake_unsupported_scheme_test(self, pet, **kwargs): # noqa: E501 + """test behavior with unsupported http scheme only # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.fake_unsupported_scheme_test(pet, async_req=True) + >>> result = thread.get() + + :param pet: Pet object that needs to be added to the store (required) + :type pet: Pet + :param query_1: query parameter + :type query_1: str + :param header_1: header parameter + :type header_1: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + return self.fake_unsupported_scheme_test_with_http_info(pet, **kwargs) # noqa: E501 + + def fake_unsupported_scheme_test_with_http_info(self, pet, **kwargs): # noqa: E501 + """test behavior with unsupported http scheme only # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.fake_unsupported_scheme_test_with_http_info(pet, async_req=True) + >>> result = thread.get() + + :param pet: Pet object that needs to be added to the store (required) + :type pet: Pet + :param query_1: query parameter + :type query_1: str + :param header_1: header parameter + :type header_1: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + local_var_params = locals() + + all_params = [ + 'pet', + 'query_1', + 'header_1' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_unsupported_scheme_test" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pet' is set + if self.api_client.client_side_validation and local_var_params.get('pet') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `pet` when calling `fake_unsupported_scheme_test`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('query_1') is not None: # noqa: E501 + query_params.append(('query_1', local_var_params['query_1'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + if 'header_1' in local_var_params: + header_params['header_1'] = local_var_params['header_1'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'pet' in local_var_params: + body_params = local_var_params['pet'] + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json', 'application/xml'], + 'GET', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['unsupported_test'] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + '/fake/unsupported-scheme-test', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + def test_body_with_binary(self, body, **kwargs): # noqa: E501 """test_body_with_binary # noqa: E501 diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.cpp b/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.cpp index cc13f3fa8a55..b3974c35f6f6 100644 --- a/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.cpp +++ b/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.cpp @@ -798,6 +798,123 @@ std::string FakePropertyEnum_intResource::extractFormParamsFromBody(const std::s } return ""; } +FakeUnsupported_scheme_testResource::FakeUnsupported_scheme_testResource(const std::string& context /* = "/v2" */) +{ + this->set_path(context + "/fake/unsupported-scheme-test"); + this->set_method_handler("GET", + std::bind(&FakeUnsupported_scheme_testResource::handler_GET_internal, this, + std::placeholders::_1)); +} + +std::pair FakeUnsupported_scheme_testResource::handleFakeApiException(const FakeApiException& e) +{ + return std::make_pair(e.getStatus(), e.what()); +} + +std::pair FakeUnsupported_scheme_testResource::handleStdException(const std::exception& e) +{ + return std::make_pair(500, e.what()); +} + +std::pair FakeUnsupported_scheme_testResource::handleUnspecifiedException() +{ + return std::make_pair(500, "Unknown exception occurred"); +} + +void FakeUnsupported_scheme_testResource::setResponseHeader(const std::shared_ptr& session, const std::string& header) +{ + session->set_header(header, ""); +} + +void FakeUnsupported_scheme_testResource::returnResponse(const std::shared_ptr& session, const int status, const std::string& result, std::multimap& responseHeaders) +{ + responseHeaders.insert(std::make_pair("Connection", "close")); + session->close(status, result, responseHeaders); +} + +void FakeUnsupported_scheme_testResource::defaultSessionClose(const std::shared_ptr& session, const int status, const std::string& result) +{ + session->close(status, result, { {"Connection", "close"} }); +} + +void FakeUnsupported_scheme_testResource::handler_GET_internal(const std::shared_ptr session) +{ + const auto request = session->get_request(); + // body params or form params here from the body content string + std::string bodyContent = extractBodyContent(session); + auto pet = extractJsonModelBodyParam(bodyContent); + // Getting the query params + std::string query1 = request->get_query_parameter("query1", ""); + // Getting the headers + std::string header1 = request->get_header("header_1", ""); + + int status_code = 500; + std::string result = ""; + + try { + status_code = + handler_GET(pet, query1, header1); + } + catch(const FakeApiException& e) { + std::tie(status_code, result) = handleFakeApiException(e); + } + catch(const std::exception& e) { + std::tie(status_code, result) = handleStdException(e); + } + catch(...) { + std::tie(status_code, result) = handleUnspecifiedException(); + } + + std::multimap< std::string, std::string > responseHeaders {}; + static const std::vector contentTypes{ + "application/json" + }; + static const std::string acceptTypes{ + "application/json, application/xml, " + }; + + if (status_code == 200) { + responseHeaders.insert(std::make_pair("Content-Type", selectPreferredContentType(contentTypes))); + if (!acceptTypes.empty()) { + responseHeaders.insert(std::make_pair("Accept", acceptTypes)); + } + + returnResponse(session, 200, result.empty() ? "{}" : result, responseHeaders); + return; + } + defaultSessionClose(session, status_code, result); +} + + +int FakeUnsupported_scheme_testResource::handler_GET( + Pet & pet, std::string & query1, std::string & header1) +{ + return handler_GET_func(pet, query1, header1); +} + + +std::string FakeUnsupported_scheme_testResource::extractBodyContent(const std::shared_ptr& session) { + const auto request = session->get_request(); + int content_length = request->get_header("Content-Length", 0); + std::string bodyContent; + session->fetch(content_length, + [&bodyContent](const std::shared_ptr session, + const restbed::Bytes &body) { + bodyContent = restbed::String::format( + "%.*s\n", (int)body.size(), body.data()); + }); + return bodyContent; +} + +std::string FakeUnsupported_scheme_testResource::extractFormParamsFromBody(const std::string& paramName, const std::string& body) { + const auto uri = restbed::Uri("urlencoded?" + body, true); + const auto params = uri.get_query_parameters(); + const auto result = params.find(paramName); + if (result != params.cend()) { + return result->second; + } + return ""; +} FakeBody_with_binaryResource::FakeBody_with_binaryResource(const std::string& context /* = "/v2" */) { this->set_path(context + "/fake/body-with-binary"); @@ -1864,6 +1981,12 @@ std::shared_ptr FakeApi::getFake } return m_spFakePropertyEnum_intResource; } +std::shared_ptr FakeApi::getFakeUnsupported_scheme_testResource() { + if (!m_spFakeUnsupported_scheme_testResource) { + setResource(std::make_shared()); + } + return m_spFakeUnsupported_scheme_testResource; +} std::shared_ptr FakeApi::getFakeBody_with_binaryResource() { if (!m_spFakeBody_with_binaryResource) { setResource(std::make_shared()); @@ -1930,6 +2053,10 @@ void FakeApi::setResource(std::shared_ptrpublish(m_spFakePropertyEnum_intResource); } +void FakeApi::setResource(std::shared_ptr resource) { + m_spFakeUnsupported_scheme_testResource = resource; + m_service->publish(m_spFakeUnsupported_scheme_testResource); +} void FakeApi::setResource(std::shared_ptr resource) { m_spFakeBody_with_binaryResource = resource; m_service->publish(m_spFakeBody_with_binaryResource); @@ -1982,6 +2109,10 @@ void FakeApi::setFakeApiFakePropertyEnum_intResource(std::shared_ptrpublish(m_spFakePropertyEnum_intResource); } +void FakeApi::setFakeApiFakeUnsupported_scheme_testResource(std::shared_ptr spFakeUnsupported_scheme_testResource) { + m_spFakeUnsupported_scheme_testResource = spFakeUnsupported_scheme_testResource; + m_service->publish(m_spFakeUnsupported_scheme_testResource); +} void FakeApi::setFakeApiFakeBody_with_binaryResource(std::shared_ptr spFakeBody_with_binaryResource) { m_spFakeBody_with_binaryResource = spFakeBody_with_binaryResource; m_service->publish(m_spFakeBody_with_binaryResource); @@ -2031,6 +2162,9 @@ void FakeApi::publishDefaultResources() { if (!m_spFakePropertyEnum_intResource) { setResource(std::make_shared()); } + if (!m_spFakeUnsupported_scheme_testResource) { + setResource(std::make_shared()); + } if (!m_spFakeBody_with_binaryResource) { setResource(std::make_shared()); } diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.h b/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.h index c2d0e1559b11..42dee19e113e 100644 --- a/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.h +++ b/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.h @@ -37,6 +37,7 @@ #include "HealthCheckResult.h" #include "OuterComposite.h" #include "OuterObjectWithEnumProperty.h" +#include "Pet.h" #include "User.h" #include #include @@ -437,6 +438,68 @@ class FakePropertyEnum_intResource: public restbed::Resource void handler_POST_internal(const std::shared_ptr session); }; +/// +/// test behavior with unsupported http scheme only +/// +/// +/// +/// +class FakeUnsupported_scheme_testResource: public restbed::Resource +{ +public: + FakeUnsupported_scheme_testResource(const std::string& context = "/v2"); + virtual ~FakeUnsupported_scheme_testResource() = default; + + FakeUnsupported_scheme_testResource( + const FakeUnsupported_scheme_testResource& other) = default; // copy constructor + FakeUnsupported_scheme_testResource(FakeUnsupported_scheme_testResource&& other) noexcept = default; // move constructor + + FakeUnsupported_scheme_testResource& operator=(const FakeUnsupported_scheme_testResource& other) = default; // copy assignment + FakeUnsupported_scheme_testResource& operator=(FakeUnsupported_scheme_testResource&& other) noexcept = default; // move assignment + + ///////////////////////////////////////////////////// + // Set these to implement the server functionality // + ///////////////////////////////////////////////////// + std::function handler_GET_func = + [](Pet &, std::string &, std::string &) -> int + { throw FakeApiException(501, "Not implemented"); }; + + +protected: + ////////////////////////////////////////////////////////// + // As an alternative to setting the `std::function`s // + // override these to implement the server functionality // + ////////////////////////////////////////////////////////// + + virtual int handler_GET( + Pet & pet, std::string & query1, std::string & header1); + + +protected: + ////////////////////////////////////// + // Override these for customization // + ////////////////////////////////////// + + virtual std::string extractBodyContent(const std::shared_ptr& session); + virtual std::string extractFormParamsFromBody(const std::string& paramName, const std::string& body); + + virtual std::pair handleFakeApiException(const FakeApiException& e); + virtual std::pair handleStdException(const std::exception& e); + virtual std::pair handleUnspecifiedException(); + + virtual void setResponseHeader(const std::shared_ptr& session, + const std::string& header); + + virtual void returnResponse(const std::shared_ptr& session, + const int status, const std::string& result, std::multimap& contentType); + virtual void defaultSessionClose(const std::shared_ptr& session, + const int status, const std::string& result); + +private: + void handler_GET_internal(const std::shared_ptr session); +}; + /// /// /// @@ -903,6 +966,7 @@ using FakeApiFakeOuterCompositeResource [[deprecated]] = FakeApiResources::FakeO using FakeApiFakeOuterNumberResource [[deprecated]] = FakeApiResources::FakeOuterNumberResource; using FakeApiFakeOuterStringResource [[deprecated]] = FakeApiResources::FakeOuterStringResource; using FakeApiFakePropertyEnum_intResource [[deprecated]] = FakeApiResources::FakePropertyEnum_intResource; +using FakeApiFakeUnsupported_scheme_testResource [[deprecated]] = FakeApiResources::FakeUnsupported_scheme_testResource; using FakeApiFakeBody_with_binaryResource [[deprecated]] = FakeApiResources::FakeBody_with_binaryResource; using FakeApiFakeBody_with_file_schemaResource [[deprecated]] = FakeApiResources::FakeBody_with_file_schemaResource; using FakeApiFakeBody_with_query_paramsResource [[deprecated]] = FakeApiResources::FakeBody_with_query_paramsResource; @@ -926,6 +990,7 @@ class FakeApi std::shared_ptr getFakeOuterNumberResource(); std::shared_ptr getFakeOuterStringResource(); std::shared_ptr getFakePropertyEnum_intResource(); + std::shared_ptr getFakeUnsupported_scheme_testResource(); std::shared_ptr getFakeBody_with_binaryResource(); std::shared_ptr getFakeBody_with_file_schemaResource(); std::shared_ptr getFakeBody_with_query_paramsResource(); @@ -940,6 +1005,7 @@ class FakeApi void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); + void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); @@ -960,6 +1026,8 @@ class FakeApi [[deprecated("use setResource()")]] virtual void setFakeApiFakePropertyEnum_intResource(std::shared_ptr spFakeApiFakePropertyEnum_intResource); [[deprecated("use setResource()")]] + virtual void setFakeApiFakeUnsupported_scheme_testResource(std::shared_ptr spFakeApiFakeUnsupported_scheme_testResource); + [[deprecated("use setResource()")]] virtual void setFakeApiFakeBody_with_binaryResource(std::shared_ptr spFakeApiFakeBody_with_binaryResource); [[deprecated("use setResource()")]] virtual void setFakeApiFakeBody_with_file_schemaResource(std::shared_ptr spFakeApiFakeBody_with_file_schemaResource); @@ -985,6 +1053,7 @@ class FakeApi std::shared_ptr m_spFakeOuterNumberResource; std::shared_ptr m_spFakeOuterStringResource; std::shared_ptr m_spFakePropertyEnum_intResource; + std::shared_ptr m_spFakeUnsupported_scheme_testResource; std::shared_ptr m_spFakeBody_with_binaryResource; std::shared_ptr m_spFakeBody_with_file_schemaResource; std::shared_ptr m_spFakeBody_with_query_paramsResource; diff --git a/samples/server/petstore/java-helidon-server/mp/README.md b/samples/server/petstore/java-helidon-server/mp/README.md index 26705f7fcaf8..f83764414202 100644 --- a/samples/server/petstore/java-helidon-server/mp/README.md +++ b/samples/server/petstore/java-helidon-server/mp/README.md @@ -19,6 +19,7 @@ curl -X POST http://petstore.swagger.io:80/v2/outer/composite curl -X POST http://petstore.swagger.io:80/v2/outer/number curl -X POST http://petstore.swagger.io:80/v2/outer/string curl -X POST http://petstore.swagger.io:80/v2/property/enum-int +curl -X GET http://petstore.swagger.io:80/v2/unsupported-scheme-test curl -X PUT http://petstore.swagger.io:80/v2/body-with-binary curl -X PUT http://petstore.swagger.io:80/v2/body-with-file-schema curl -X PUT http://petstore.swagger.io:80/v2/body-with-query-params diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java index 93996a4d4171..6286d1cbaab7 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java @@ -23,6 +23,7 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; +import org.openapitools.server.model.Pet; import org.openapitools.server.model.User; import jakarta.ws.rs.*; @@ -72,6 +73,11 @@ public interface FakeService { @Produces({ "*/*" }) OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty); + @GET + @Path("/unsupported-scheme-test") + @Consumes({ "application/json", "application/xml" }) + void fakeUnsupportedSchemeTest(@Valid @NotNull Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1); + @PUT @Path("/body-with-binary") @Consumes({ "image/png" }) diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java index 2eeb01d5ca85..97bf66013140 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -23,6 +23,7 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; +import org.openapitools.server.model.Pet; import org.openapitools.server.model.User; import jakarta.ws.rs.*; @@ -91,6 +92,12 @@ public OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(@Valid @NotN return result; } + @GET + @Path("/unsupported-scheme-test") + @Consumes({ "application/json", "application/xml" }) + public void fakeUnsupportedSchemeTest(@Valid @NotNull Pet pet,@QueryParam("query_1") String query1,@HeaderParam("header_1") String header1) { + } + @PUT @Path("/body-with-binary") @Consumes({ "image/png" }) diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml index 1b071eeae99a..947008aee487 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml @@ -1218,6 +1218,38 @@ paths: tags: - fake x-accepts: application/json + /fake/unsupported-scheme-test: + get: + operationId: fake-unsupported-scheme-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - unsupported_test: [] + summary: test behavior with unsupported http scheme only + tags: + - fake + x-content-type: application/json + x-accepts: application/json components: requestBodies: UserArray: @@ -2135,3 +2167,6 @@ components: bearerFormat: JWT scheme: bearer type: http + unsupported_test: + scheme: foobar + type: http diff --git a/samples/server/petstore/java-helidon-server/se/README.md b/samples/server/petstore/java-helidon-server/se/README.md index edc502506f6f..90f63bb45252 100644 --- a/samples/server/petstore/java-helidon-server/se/README.md +++ b/samples/server/petstore/java-helidon-server/se/README.md @@ -19,6 +19,7 @@ curl -X POST http://petstore.swagger.io:80/v2/fake/outer/composite curl -X POST http://petstore.swagger.io:80/v2/fake/outer/number curl -X POST http://petstore.swagger.io:80/v2/fake/outer/string curl -X POST http://petstore.swagger.io:80/v2/fake/property/enum-int +curl -X GET http://petstore.swagger.io:80/v2/fake/unsupported-scheme-test curl -X PUT http://petstore.swagger.io:80/v2/fake/body-with-binary curl -X PUT http://petstore.swagger.io:80/v2/fake/body-with-file-schema curl -X PUT http://petstore.swagger.io:80/v2/fake/body-with-query-params diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java index 67e55a492600..7e6a79425042 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java @@ -13,6 +13,7 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; +import org.openapitools.server.model.Pet; import org.openapitools.server.model.User; import io.helidon.webserver.Routing; @@ -34,6 +35,7 @@ default void update(Routing.Rules rules) { rules.post("/fake/outer/number", this::fakeOuterNumberSerialize); rules.post("/fake/outer/string", this::fakeOuterStringSerialize); rules.post("/fake/property/enum-int", Handler.create(OuterObjectWithEnumProperty.class, this::fakePropertyEnumIntegerSerialize)); + rules.get("/fake/unsupported-scheme-test", Handler.create(Pet.class, this::fakeUnsupportedSchemeTest)); rules.put("/fake/body-with-binary", this::testBodyWithBinary); rules.put("/fake/body-with-file-schema", Handler.create(FileSchemaTestClass.class, this::testBodyWithFileSchema)); rules.put("/fake/body-with-query-params", Handler.create(User.class, this::testBodyWithQueryParams)); @@ -91,6 +93,14 @@ default void update(Routing.Rules rules) { */ void fakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response, OuterObjectWithEnumProperty outerObjectWithEnumProperty); + /** + * GET /fake/unsupported-scheme-test : test behavior with unsupported http scheme only. + * @param request the server request + * @param response the server response + * @param pet Pet object that needs to be added to the store + */ + void fakeUnsupportedSchemeTest(ServerRequest request, ServerResponse response, Pet pet); + /** * PUT /fake/body-with-binary. * @param request the server request diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java index 0dd3bbf090c3..d2420e6a2012 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -13,6 +13,7 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; +import org.openapitools.server.model.Pet; import org.openapitools.server.model.User; import java.util.logging.Logger; @@ -50,6 +51,10 @@ public void fakePropertyEnumIntegerSerialize(ServerRequest request, ServerRespon response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); } + public void fakeUnsupportedSchemeTest(ServerRequest request, ServerResponse response, Pet pet) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + public void testBodyWithBinary(ServerRequest request, ServerResponse response) { response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); } diff --git a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml index 1b071eeae99a..947008aee487 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml @@ -1218,6 +1218,38 @@ paths: tags: - fake x-accepts: application/json + /fake/unsupported-scheme-test: + get: + operationId: fake-unsupported-scheme-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - unsupported_test: [] + summary: test behavior with unsupported http scheme only + tags: + - fake + x-content-type: application/json + x-accepts: application/json components: requestBodies: UserArray: @@ -2135,3 +2167,6 @@ components: bearerFormat: JWT scheme: bearer type: http + unsupported_test: + scheme: foobar + type: http diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java index 15de85ef0d03..86042ef8d74c 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java @@ -17,6 +17,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.OuterObjectWithEnumProperty; +import org.openapitools.model.Pet; import org.openapitools.model.User; import java.util.Map; @@ -137,6 +138,20 @@ public Response fakePropertyEnumIntegerSerialize(@ApiParam(value = "Input enum ( throws NotFoundException { return delegate.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty, securityContext); } + @javax.ws.rs.GET + @Path("/unsupported-scheme-test") + @Consumes({ "application/json", "application/xml" }) + + @io.swagger.annotations.ApiOperation(value = "test behavior with unsupported http scheme only", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "unsupported_test") + }, tags={ "fake", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "The instance started successfully", response = Void.class) + }) + public Response fakeUnsupportedSchemeTest(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet pet,@ApiParam(value = "query parameter") @QueryParam("query_1") String query1,@ApiParam(value = "header parameter" )@HeaderParam("header_1") String header1,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.fakeUnsupportedSchemeTest(pet, query1, header1, securityContext); + } @javax.ws.rs.PUT @Path("/body-with-binary") @Consumes({ "image/png" }) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java index f6df9b4c178d..bf6db52975f3 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java @@ -15,6 +15,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.OuterObjectWithEnumProperty; +import org.openapitools.model.Pet; import org.openapitools.model.User; import java.util.List; @@ -33,6 +34,7 @@ public abstract class FakeApiService { public abstract Response fakeOuterNumberSerialize(BigDecimal body,SecurityContext securityContext) throws NotFoundException; public abstract Response fakeOuterStringSerialize(String body,SecurityContext securityContext) throws NotFoundException; public abstract Response fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty,SecurityContext securityContext) throws NotFoundException; + public abstract Response fakeUnsupportedSchemeTest(Pet pet,String query1,String header1,SecurityContext securityContext) throws NotFoundException; public abstract Response testBodyWithBinary(File body,SecurityContext securityContext) throws NotFoundException; public abstract Response testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass,SecurityContext securityContext) throws NotFoundException; public abstract Response testBodyWithQueryParams( @NotNull String query,User user,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index dbd154f06163..51079420f61f 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -12,6 +12,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.OuterObjectWithEnumProperty; +import org.openapitools.model.Pet; import org.openapitools.model.User; import java.util.List; @@ -57,6 +58,11 @@ public Response fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty out return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override + public Response fakeUnsupportedSchemeTest(Pet pet, String query1, String header1, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response testBodyWithBinary(File body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php index b3f253509c5b..c608d9b7a649 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php @@ -538,4 +538,32 @@ public function testQueryParameterCollectionFormat() return response('How about implementing testQueryParameterCollectionFormat as a put method ?'); } + /** + * Operation fakeUnsupportedSchemeTest + * + * test behavior with unsupported http scheme only. + * + * + * @return Http response + */ + public function fakeUnsupportedSchemeTest() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['pet'])) { + throw new \InvalidArgumentException('Missing the required parameter $pet when calling fakeUnsupportedSchemeTest'); + } + $pet = $input['pet']; + + $query1 = $input['query1']; + + $header1 = $input['header1']; + + + return response('How about implementing fakeUnsupportedSchemeTest as a get method ?'); + } } diff --git a/samples/server/petstore/php-laravel/lib/routes/api.php b/samples/server/petstore/php-laravel/lib/routes/api.php index 2747adcaf5fc..cef127394d6f 100644 --- a/samples/server/petstore/php-laravel/lib/routes/api.php +++ b/samples/server/petstore/php-laravel/lib/routes/api.php @@ -147,6 +147,13 @@ */ Route::put('/v2/fake/test-query-parameters', 'FakeController@testQueryParameterCollectionFormat'); +/** + * get fakeUnsupportedSchemeTest + * Summary: test behavior with unsupported http scheme only + * Notes: + + */ +Route::get('/v2/fake/unsupported-scheme-test', 'FakeController@fakeUnsupportedSchemeTest'); /** * patch testClassname * Summary: To test class name in snake case diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php index 44c47a7ac47c..9656fe319299 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php @@ -534,4 +534,32 @@ public function testQueryParameterCollectionFormat() return response('How about implementing testQueryParameterCollectionFormat as a put method ?'); } + /** + * Operation fakeUnsupportedSchemeTest + * + * test behavior with unsupported http scheme only. + * + * + * @return Http response + */ + public function fakeUnsupportedSchemeTest() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['pet'])) { + throw new \InvalidArgumentException('Missing the required parameter $pet when calling fakeUnsupportedSchemeTest'); + } + $pet = $input['pet']; + + $query_1 = $input['query_1']; + + $header_1 = $input['header_1']; + + + return response('How about implementing fakeUnsupportedSchemeTest as a get method ?'); + } } diff --git a/samples/server/petstore/php-lumen/lib/routes/web.php b/samples/server/petstore/php-lumen/lib/routes/web.php index a5126e8531f4..e0615df2ca17 100644 --- a/samples/server/petstore/php-lumen/lib/routes/web.php +++ b/samples/server/petstore/php-lumen/lib/routes/web.php @@ -163,6 +163,13 @@ */ $router->put('/v2/fake/test-query-parameters', 'FakeApi@testQueryParameterCollectionFormat'); +/** + * get fakeUnsupportedSchemeTest + * Summary: test behavior with unsupported http scheme only + * Notes: + */ +$router->get('/v2/fake/unsupported-scheme-test', 'FakeApi@fakeUnsupportedSchemeTest'); + /** * patch testClassname * Summary: To test class name in snake case