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/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/README.mustache b/modules/openapi-generator/src/main/resources/Java/README.mustache index 7a78735e217f..1b2d129967d5 100644 --- a/modules/openapi-generator/src/main/resources/Java/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/README.mustache @@ -212,10 +212,18 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasic}} +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}} - **Type**: OAuth 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/apache-httpclient/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/README.mustache index 97c99cc36a5c..7f484467430f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/README.mustache @@ -173,10 +173,18 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasic}} +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}} - **Type**: OAuth 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..8fbb0ce8c4b2 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 @@ -101,7 +101,12 @@ public class ApiClient { auth = new HttpBasicAuth(); {{/isBasicBasic}} {{^isBasicBasic}} + {{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); + {{/isBasicBearer}} + {{^isBasicBearer}} + throw new RuntimeException("auth name \"" + authName + "\" does not have a supported http scheme type"); + {{/isBasicBearer}} {{/isBasicBasic}} {{/isBasic}} {{#isApiKey}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache index aee6dd8e24f7..0d183007abdc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache @@ -154,10 +154,18 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasic}} +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}} - **Type**: OAuth 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/okhttp-gson/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache index 2ab9946deb8d..2671b9a4550f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache @@ -168,8 +168,12 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} 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 b9693eda4603..c95f206588d3 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 @@ -138,8 +138,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..db41c807674c 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 @@ -66,7 +66,12 @@ public class ApiClient { auth = new HttpBasicAuth(); {{/isBasicBasic}} {{^isBasicBasic}} + {{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); + {{/isBasicBearer}} + {{^isBasicBearer}} + throw new RuntimeException("auth name \"" + authName + "\" does not have a supported http scheme type"); + {{/isBasicBearer}} {{/isBasicBasic}} {{/isBasic}} {{#isApiKey}} 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..5b736fa9a311 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,11 @@ public class ApiClient { {{#authMethods}}if ("{{name}}".equals(authName)) { {{#isBasic}}{{#isBasicBasic}} auth = new HttpBasicAuth(); - {{/isBasicBasic}}{{^isBasicBasic}} + {{/isBasicBasic}}{{^isBasicBasic}}{{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}}{{/isBasic}} + {{/isBasicBearer}}{{^isBasicBearer}} + throw new RuntimeException("auth name \"" + authName + "\" does not have a supported http scheme type"); + {{/isBasicBearer}}{{/isBasicBasic}}{{/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/retrofit2/play25/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache index 849e0665e8cc..0e2f36734864 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache @@ -44,8 +44,8 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap<>();{{#authMethods}}{{#isBasic}} - // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}} + authentications = new HashMap<>();{{#authMethods}}{{#isBasicBasic}} + // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"query"{{/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/retrofit2/play26/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/ApiClient.mustache index b752b433d057..574a352b845a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/ApiClient.mustache @@ -59,8 +59,8 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap<>();{{#authMethods}}{{#isBasic}} - // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}} + authentications = new HashMap<>();{{#authMethods}}{{#isBasicBasic}} + // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#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/java-micronaut/client/doc/auth.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/doc/auth.mustache index 50252389b19f..3ec68009216e 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut/client/doc/auth.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/doc/auth.mustache @@ -4,10 +4,10 @@ # {{name}} {{! basic auth -}}{{#isBasic}}Authorization method is of **basic auth**. +}}{{#isBasicBasic}}Authorization method is of **basic auth**. {{#configureAuth}}The configuration for it can be found in [application.yml](src/main/resources/application.yml) at `security.basic-auth.{{name}}`. `username` and `password` need to be filled for it to work correctly.{{/configureAuth}}{{^configureAuth}}It can be configured in the [application.yml](src/main/resources/application.yml) using Micronaut security features.{{/configureAuth}} -{{/isBasic}}{{! +{{/isBasicBasic}}{{! api key }}{{#isApiKey}}Authorization method is of **api key type**. The parameter `{{{keyParamName}}}` is located in `{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}{{#isKeyInCookie}}cookie{{/isKeyInCookie}}`. diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/application.yml.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/application.yml.mustache index b85b30195dd2..f089d4ffeec7 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/application.yml.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/application.yml.mustache @@ -47,12 +47,12 @@ micronaut: # TODO fill in api key for {{{name}}} authorization api-key: {{/isApiKey}}{{/authMethods}} - {{!basic authorization}}basic-auth:{{#authMethods}}{{#isBasic}} + {{!basic authorization}}basic-auth:{{#authMethods}}{{#isBasicBasic}} {{{name}}}: # TODO fill in credentials for {{{name}}} authorization username: password: - {{/isBasic}}{{/authMethods}}{{/configureAuth}} + {{/isBasicBasic}}{{/authMethods}}{{/configureAuth}} {{/client}} {{!SERVER CONFIGURATION}} {{#server}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache index 63cc4054f35c..99007cfc4760 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache @@ -90,8 +90,12 @@ No model defined in this package - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} 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/jvm-retrofit2/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache index c699814fe9b4..b9c7716d5f71 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache @@ -128,7 +128,7 @@ import okhttp3.MediaType.Companion.toMediaType ) : this(baseUrl, okHttpClientBuilder{{^kotlinx_serialization}}, serializerBuilder{{/kotlinx_serialization}}) { authNames.forEach { authName -> val auth = when (authName) { - {{#authMethods}}"{{name}}" -> {{#isBasic}}{{#isBasicBasic}}HttpBasicAuth(){{/isBasicBasic}}{{#isBasicBearer}}HttpBearerAuth("{{scheme}}"){{/isBasicBearer}}{{/isBasic}}{{#isApiKey}}ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"){{/isApiKey}}{{#isOAuth}}OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"){{/isOAuth}}{{/authMethods}} + {{#authMethods}}"{{name}}" -> {{#isBasic}}{{#isBasicBasic}}HttpBasicAuth(){{/isBasicBasic}}{{^isBasicBasic}}{{#isBasicBearer}}HttpBearerAuth("{{scheme}}"){{/isBasicBearer}}{{^isBasicBearer}}throw RuntimeException("auth name $authName does not have a supported http scheme type"){{/isBasicBearer}}{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}}ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"){{/isApiKey}}{{#isOAuth}}OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"){{/isOAuth}}{{/authMethods}} else -> throw RuntimeException("auth name $authName not found in available auth names") } addAuthorization(authName, auth) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/README.mustache index 125192b11132..4aff1e8f1bc6 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/README.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/README.mustache @@ -213,8 +213,12 @@ No model defined in this package - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/authentication.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/authentication.mustache index 707a8c25fe34..5c3fb1c77c26 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/authentication.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/authentication.mustache @@ -5,9 +5,9 @@ companion object Authentication { {{#isApiKey}} {{>auth/apikeyauth}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} {{>auth/httpbasicauth}} -{{/isBasic}} +{{/isBasicBasic}} {{#isOAuth}} // TODO: Oauth not implemented yet - comment out below as OAuth does not exist {{/isOAuth}} 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/main/resources/kotlin-server-deprecated/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/README.mustache index 5e2bcb9d0e9e..724690a37830 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/README.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/README.mustache @@ -65,8 +65,12 @@ No model defined in this package - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/AppMain.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/AppMain.kt.mustache index bef736de059b..5bcf36644d28 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/AppMain.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/AppMain.kt.mustache @@ -86,7 +86,7 @@ fun Application.main() { {{#hasAuthMethods}} install(Authentication) { {{#authMethods}} - {{#isBasic}} + {{#isBasicBasic}} basic("{{{name}}}") { validate { credentials -> // TODO: "Apply your basic authentication functionality." @@ -97,7 +97,7 @@ fun Application.main() { null } } - {{/isBasic}} + {{/isBasicBasic}} {{#isApiKey}} // "Implement API key auth ({{{name}}}) for parameter name '{{{keyParamName}}}'." apiKeyAuth("{{{name}}}") { diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/README.mustache index 221b63ea42b1..f539d4a510e4 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/README.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/README.mustache @@ -82,8 +82,12 @@ No model defined in this package - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_principal.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_principal.mustache index d49c5d537f01..422f5549cac8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_principal.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/libraries/ktor/_principal.mustache @@ -1,7 +1,7 @@ {{#authMethods}} -{{#isBasic}} +{{#isBasicBasic}} val principal = call.authentication.principal() -{{/isBasic}} +{{/isBasicBasic}} {{#isApiKey}} val principal = call.authentication.principal() {{/isApiKey}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/README.mustache index cf18405ead3a..01001ae1d834 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/README.mustache @@ -65,8 +65,12 @@ No model defined in this package - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/AppMain.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/AppMain.kt.mustache index cd541791456e..5ba3775c92cf 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/AppMain.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/AppMain.kt.mustache @@ -85,7 +85,7 @@ fun Application.main() { {{#hasAuthMethods}} install(Authentication) { {{#authMethods}} - {{#isBasic}} + {{#isBasicBasic}} basic("{{{name}}}") { validate { credentials -> // TODO: "Apply your basic authentication functionality." @@ -96,7 +96,7 @@ fun Application.main() { null } } - {{/isBasic}} + {{/isBasicBasic}} {{#isApiKey}} // "Implement API key auth ({{{name}}}) for parameter name '{{{keyParamName}}}'." apiKeyAuth("{{{name}}}") { diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/README.mustache index 2e9f2f4c9889..5c3a10ef2121 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/README.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/README.mustache @@ -82,8 +82,12 @@ No model defined in this package - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_principal.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_principal.mustache index 09ae65906ea2..0dd073a8ecd8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_principal.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/_principal.mustache @@ -1,7 +1,7 @@ {{#authMethods}} -{{#isBasic}} +{{#isBasicBasic}} val principal = call.authentication.principal()!! -{{/isBasic}} +{{/isBasicBasic}} {{#isApiKey}} val principal = call.authentication.principal()!! {{/isApiKey}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/README.mustache index 624db1ac9182..26d8f29cf585 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/README.mustache @@ -20,28 +20,28 @@ This runs all tests and packages the library. * Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. {{#generateApiDocs}} - - ## Documentation for API Endpoints + +## Documentation for API Endpoints - All URIs are relative to *{{{basePath}}}* +All URIs are relative to *{{{basePath}}}* - Class | Method | HTTP request | Description - ------------ | ------------- | ------------- | ------------- - {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} - {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} {{/generateApiDocs}} {{#generateModelDocs}} - - ## Documentation for Models - - {{#modelPackage}} - {{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) - {{/model}}{{/models}} - {{/modelPackage}} - {{^modelPackage}} - No model defined in this package - {{/modelPackage}} + +## Documentation for Models + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} {{/generateModelDocs}} @@ -50,21 +50,25 @@ This runs all tests and packages the library. {{^authMethods}}Endpoints do not require authorization.{{/authMethods}} {{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} {{#authMethods}} - - ### {{name}} - - {{#isApiKey}}- **Type**: API key - - **API key parameter name**: {{keyParamName}} - - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} - {{/isApiKey}} - {{#isBasic}}- **Type**: HTTP basic authentication - {{/isBasic}} - {{#isOAuth}}- **Type**: OAuth - - **Flow**: {{flow}} - - **Authorization URL**: {{authorizationUrl}} - - **Scopes**: {{^scopes}}N/A{{/scopes}} - {{#scopes}} - {{scope}}: {{description}} - {{/scopes}} - {{/isOAuth}} + +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} {{/authMethods}} \ No newline at end of file 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..5d45861acd8f 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 @@ -143,9 +143,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // 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 = new HashMap();{{#authMethods}}{{#isBasicBasic}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{#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/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/samples/client/petstore/java/apache-httpclient/README.md b/samples/client/petstore/java/apache-httpclient/README.md index c0f807b03cf9..8d585ca2a674 100644 --- a/samples/client/petstore/java/apache-httpclient/README.md +++ b/samples/client/petstore/java/apache-httpclient/README.md @@ -243,13 +243,13 @@ Authentication schemes defined for the API: ### bearer_test -- **Type**: HTTP basic authentication +- **Type**: HTTP Bearer Token authentication (JWT) ### http_signature_test -- **Type**: HTTP basic authentication +- **Type**: HTTP signature authentication ## Recommendation 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..c357df720157 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 + "\" does not have a supported http scheme type"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } diff --git a/samples/client/petstore/java/jersey3/README.md b/samples/client/petstore/java/jersey3/README.md index 50ee542abfc7..139c8a1514a3 100644 --- a/samples/client/petstore/java/jersey3/README.md +++ b/samples/client/petstore/java/jersey3/README.md @@ -276,13 +276,13 @@ Authentication schemes defined for the API: ### bearer_test -- **Type**: HTTP basic authentication +- **Type**: HTTP Bearer Token authentication (JWT) ### http_signature_test -- **Type**: HTTP basic authentication +- **Type**: HTTP signature authentication ## Recommendation diff --git a/samples/client/petstore/java/native-async/README.md b/samples/client/petstore/java/native-async/README.md index baaf9d47abd0..5b7379fc972b 100644 --- a/samples/client/petstore/java/native-async/README.md +++ b/samples/client/petstore/java/native-async/README.md @@ -308,13 +308,13 @@ Authentication schemes defined for the API: ### bearer_test -- **Type**: HTTP basic authentication +- **Type**: HTTP Bearer Token authentication (JWT) ### http_signature_test -- **Type**: HTTP basic authentication +- **Type**: HTTP signature authentication ## Recommendation diff --git a/samples/client/petstore/java/native/README.md b/samples/client/petstore/java/native/README.md index 79aac75557f0..57c43bb66e69 100644 --- a/samples/client/petstore/java/native/README.md +++ b/samples/client/petstore/java/native/README.md @@ -307,13 +307,13 @@ Authentication schemes defined for the API: ### bearer_test -- **Type**: HTTP basic authentication +- **Type**: HTTP Bearer Token authentication (JWT) ### http_signature_test -- **Type**: HTTP basic authentication +- **Type**: HTTP signature authentication ## Recommendation diff --git a/samples/client/petstore/java/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index c3bd6a49b45f..27613fe7b2cf 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -275,12 +275,7 @@ Authentication schemes defined for the API: ### bearer_test -- **Type**: HTTP basic authentication - - -### http_signature_test - -- **Type**: HTTP basic authentication +- **Type**: HTTP Bearer Token authentication (JWT) ## Recommendation diff --git a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml index c14ba32722ff..954401cb158f 100644 --- a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml @@ -61,7 +61,6 @@ paths: "405": description: Invalid input security: - - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -83,7 +82,6 @@ paths: "405": description: Validation exception security: - - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -133,7 +131,6 @@ paths: "400": description: Invalid status value security: - - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -175,7 +172,6 @@ paths: "400": description: Invalid tag value security: - - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -2399,7 +2395,4 @@ components: bearerFormat: JWT scheme: bearer type: http - http_signature_test: - scheme: signature - type: http diff --git a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md index 8c536d28f95d..bfdf00b0f1a3 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md @@ -42,7 +42,6 @@ public class Example { OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - PetApi apiInstance = new PetApi(defaultClient); Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { @@ -70,7 +69,7 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) +[petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -177,7 +176,6 @@ public class Example { OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - PetApi apiInstance = new PetApi(defaultClient); List status = Arrays.asList("available"); // List | Status values that need to be considered for filter try { @@ -206,7 +204,7 @@ public class Example { ### Authorization -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) +[petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -246,7 +244,6 @@ public class Example { OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - PetApi apiInstance = new PetApi(defaultClient); List tags = Arrays.asList(); // List | Tags to filter by try { @@ -275,7 +272,7 @@ public class Example { ### Authorization -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) +[petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -386,7 +383,6 @@ public class Example { OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - PetApi apiInstance = new PetApi(defaultClient); Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { @@ -414,7 +410,7 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) +[petstore_auth](../README.md#petstore_auth) ### HTTP request headers 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 status, final ApiCallback localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -511,7 +511,7 @@ public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _cal localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -778,7 +778,7 @@ public okhttp3.Call updatePetCall(Pet pet, final ApiCallback _callback) throws A localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } diff --git a/samples/client/petstore/java/webclient-jakarta/README.md b/samples/client/petstore/java/webclient-jakarta/README.md index 2109736324e3..3778932ea897 100644 --- a/samples/client/petstore/java/webclient-jakarta/README.md +++ b/samples/client/petstore/java/webclient-jakarta/README.md @@ -250,13 +250,13 @@ Authentication schemes defined for the API: ### bearer_test -- **Type**: HTTP basic authentication +- **Type**: HTTP Bearer Token authentication (JWT) ### http_signature_test -- **Type**: HTTP basic authentication +- **Type**: HTTP signature authentication ## Recommendation diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/ApiClient.java index c5ba27b85c34..63234665a04b 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/ApiClient.java @@ -152,7 +152,6 @@ protected void init() { 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/webclient/README.md b/samples/client/petstore/java/webclient/README.md index 2109736324e3..3778932ea897 100644 --- a/samples/client/petstore/java/webclient/README.md +++ b/samples/client/petstore/java/webclient/README.md @@ -250,13 +250,13 @@ Authentication schemes defined for the API: ### bearer_test -- **Type**: HTTP basic authentication +- **Type**: HTTP Bearer Token authentication (JWT) ### http_signature_test -- **Type**: HTTP basic authentication +- **Type**: HTTP signature authentication ## Recommendation diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java index 009552ddb722..d582b89eece9 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java @@ -152,7 +152,6 @@ protected void init() { 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/openapi3/client/petstore/java/jersey2-java8/README.md b/samples/openapi3/client/petstore/java/jersey2-java8/README.md index 74316c6f19d9..b9fb5b817bdb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/README.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/README.md @@ -301,13 +301,13 @@ Authentication schemes defined for the API: ### bearer_test -- **Type**: HTTP basic authentication +- **Type**: HTTP Bearer Token authentication (JWT) ### http_signature_test -- **Type**: HTTP basic authentication +- **Type**: HTTP signature authentication ## Recommendation diff --git a/samples/server/petstore/kotlin-vertx-modelMutable/README.md b/samples/server/petstore/kotlin-vertx-modelMutable/README.md index f510dff19bc3..b0ed2b775ae7 100644 --- a/samples/server/petstore/kotlin-vertx-modelMutable/README.md +++ b/samples/server/petstore/kotlin-vertx-modelMutable/README.md @@ -19,65 +19,65 @@ This runs all tests and packages the library. * Supports collection formats for query parameters: csv, tsv, ssv, pipes. * Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. - - ## Documentation for API Endpoints - - All URIs are relative to *http://petstore.swagger.io/v2* - - Class | Method | HTTP request | Description - ------------ | ------------- | ------------- | ------------- - *PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store - *PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet - *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status - *PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags - *PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID - *PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet - *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data - *PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image - *StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID - *StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status - *StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID - *StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - *UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user - *UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array - *UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array - *UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user - *UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name - *UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system - *UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session - *UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - - - ## Documentation for Models - - - [org.openapitools.server.api.model.Category](docs/Category.md) - - [org.openapitools.server.api.model.ModelApiResponse](docs/ModelApiResponse.md) - - [org.openapitools.server.api.model.Order](docs/Order.md) - - [org.openapitools.server.api.model.Pet](docs/Pet.md) - - [org.openapitools.server.api.model.Tag](docs/Tag.md) - - [org.openapitools.server.api.model.User](docs/User.md) - + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.server.api.model.Category](docs/Category.md) + - [org.openapitools.server.api.model.ModelApiResponse](docs/ModelApiResponse.md) + - [org.openapitools.server.api.model.Order](docs/Order.md) + - [org.openapitools.server.api.model.Pet](docs/Pet.md) + - [org.openapitools.server.api.model.Tag](docs/Tag.md) + - [org.openapitools.server.api.model.User](docs/User.md) + ## Documentation for Authorization Authentication schemes defined for the API: - - ### petstore_auth - - - **Type**: OAuth - - **Flow**: implicit - - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - - **Scopes**: - - write:pets: modify pets in your account + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account - read:pets: read your pets - - ### api_key + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header - - **Type**: API key - - **API key parameter name**: api_key - - **Location**: HTTP header - diff --git a/samples/server/petstore/kotlin/vertx/README.md b/samples/server/petstore/kotlin/vertx/README.md index f510dff19bc3..b0ed2b775ae7 100644 --- a/samples/server/petstore/kotlin/vertx/README.md +++ b/samples/server/petstore/kotlin/vertx/README.md @@ -19,65 +19,65 @@ This runs all tests and packages the library. * Supports collection formats for query parameters: csv, tsv, ssv, pipes. * Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. - - ## Documentation for API Endpoints - - All URIs are relative to *http://petstore.swagger.io/v2* - - Class | Method | HTTP request | Description - ------------ | ------------- | ------------- | ------------- - *PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store - *PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet - *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status - *PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags - *PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID - *PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet - *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data - *PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image - *StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID - *StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status - *StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID - *StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - *UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user - *UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array - *UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array - *UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user - *UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name - *UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system - *UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session - *UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - - - ## Documentation for Models - - - [org.openapitools.server.api.model.Category](docs/Category.md) - - [org.openapitools.server.api.model.ModelApiResponse](docs/ModelApiResponse.md) - - [org.openapitools.server.api.model.Order](docs/Order.md) - - [org.openapitools.server.api.model.Pet](docs/Pet.md) - - [org.openapitools.server.api.model.Tag](docs/Tag.md) - - [org.openapitools.server.api.model.User](docs/User.md) - + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.server.api.model.Category](docs/Category.md) + - [org.openapitools.server.api.model.ModelApiResponse](docs/ModelApiResponse.md) + - [org.openapitools.server.api.model.Order](docs/Order.md) + - [org.openapitools.server.api.model.Pet](docs/Pet.md) + - [org.openapitools.server.api.model.Tag](docs/Tag.md) + - [org.openapitools.server.api.model.User](docs/User.md) + ## Documentation for Authorization Authentication schemes defined for the API: - - ### petstore_auth - - - **Type**: OAuth - - **Flow**: implicit - - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - - **Scopes**: - - write:pets: modify pets in your account + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account - read:pets: read your pets - - ### api_key + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header - - **Type**: API key - - **API key parameter name**: api_key - - **Location**: HTTP header -