From b091589e394174277e026f471d61980b42385589 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 30 Dec 2024 16:56:04 +0800 Subject: [PATCH] fix typo in various generators, templates --- .../org/openapitools/codegen/InlineModelResolver.java | 2 +- .../codegen/languages/ScalaCaskServerCodegen.java | 2 +- .../openapitools/codegen/languages/SpringCodegen.java | 6 +++--- .../cpp-rest-sdk-client/modelbase-header.mustache | 2 +- .../csharp-functions/HttpSigningConfiguration.mustache | 2 +- .../resources/csharp/HttpSigningConfiguration.mustache | 2 +- .../libraries/generichost/ExceptionEventArgs.mustache | 2 +- .../generichost/HttpSigningConfiguration.mustache | 2 +- .../main/resources/php/libraries/psr-18/api.mustache | 10 +++++----- .../src/main/resources/r/api_client.mustache | 6 +++--- .../resources/r/libraries/httr2/api_client.mustache | 8 ++++---- .../src/main/resources/rust-server/auth.mustache | 2 +- .../server-request-body-multipart-form.mustache | 2 +- .../src/main/resources/xojo-client/README.mustache | 2 +- .../src/main/resources/zapier/authentication.mustache | 2 +- .../openapitools/codegen/InlineModelResolverTest.java | 2 +- .../openapitools/codegen/OpenAPINormalizerTest.java | 2 +- 17 files changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java index a54542c1243c..8cdf045a4249 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java @@ -629,7 +629,7 @@ private void flattenComponentResponses() { * breed: * type: string * - * @param key a unique name ofr the composed schema. + * @param key a unique name for the composed schema. * @param children the list of nested schemas within a composed schema (allOf, anyOf, oneOf). * @param skipAllOfInlineSchemas true if allOf inline schemas need to be skipped. */ diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java index b257e2eba22d..9339370f286e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java @@ -1179,7 +1179,7 @@ private static String queryArgs(final CodegenOperation op) { *

* The data variant can have nulls and other non-scala things, but they know how to create validated model objects. *

- * This 'asScalaDataType' is used to ensure the type hierarchy is correct for both the model and data varients. + * This 'asScalaDataType' is used to ensure the type hierarchy is correct for both the model and data variants. *

* e.g. consider this example: * ``` diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index cb3c52a99c75..e62c275622a2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -1073,7 +1073,7 @@ private Set reformatProvideArgsParams(Operation operation) { if (argObj instanceof List) { List provideArgs = (List) argObj; if (!provideArgs.isEmpty()) { - List formatedArgs = new ArrayList<>(); + List formattedArgs = new ArrayList<>(); for (String oneArg : provideArgs) { if (StringUtils.isNotEmpty(oneArg)) { String regexp = "(?@)?(?(?(\\w+\\.)*)(?\\w+))(?\\(.*?\\))?\\s?"; @@ -1095,10 +1095,10 @@ private Set reformatProvideArgsParams(Operation operation) { } String newArg = String.join(" ", newArgs); LOGGER.trace("new arg {} {}", newArg); - formatedArgs.add(newArg); + formattedArgs.add(newArg); } } - operation.getExtensions().put("x-spring-provide-args", formatedArgs); + operation.getExtensions().put("x-spring-provide-args", formattedArgs); } } return provideArgsClassSet; diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache index 04c578517981..b97a7ad8da5f 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache @@ -229,7 +229,7 @@ web::json::value ModelBase::toJson( const std::vector& value ) template web::json::value ModelBase::toJson( const std::set& value ) { - // There's no protoype web::json::value::array(...) taking a std::set parameter. Converting to std::vector to get an array. + // There's no prototype web::json::value::array(...) taking a std::set parameter. Converting to std::vector to get an array. std::vector ret; for ( const auto& x : value ) { diff --git a/modules/openapi-generator/src/main/resources/csharp-functions/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-functions/HttpSigningConfiguration.mustache index f5cc312c6fe5..58c9cf6dba32 100644 --- a/modules/openapi-generator/src/main/resources/csharp-functions/HttpSigningConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-functions/HttpSigningConfiguration.mustache @@ -59,7 +59,7 @@ namespace {{packageName}}.Client public string SigningAlgorithm { get; set; } ///

- /// Gets the Signature validaty period in seconds + /// Gets the Signature validity period in seconds /// public int SignatureValidityPeriod { get; set; } diff --git a/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache index faca675944a3..3105952c2473 100644 --- a/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache @@ -389,7 +389,7 @@ namespace {{packageName}}.Client } /// - /// Convert ANS1 format to DER format. Not recommended to use because it generate inavlid signature occationally. + /// Convert ANS1 format to DER format. Not recommended to use because it generate invalid signature occasionally. /// /// /// diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ExceptionEventArgs.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ExceptionEventArgs.mustache index 016ef7c697f2..b74fcfa0a1de 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ExceptionEventArgs.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ExceptionEventArgs.mustache @@ -13,7 +13,7 @@ namespace {{packageName}}.{{clientPackage}} public Exception Exception { get; } /// - /// The ExcepetionEventArgs + /// The ExceptionEventArgs /// /// public ExceptionEventArgs(Exception exception) diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/HttpSigningConfiguration.mustache index 5e0f7739df06..357626fcc6c2 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/HttpSigningConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/HttpSigningConfiguration.mustache @@ -65,7 +65,7 @@ namespace {{packageName}}.{{clientPackage}} public string SigningAlgorithm { get; set; } /// - /// Gets the Signature validaty period in seconds + /// Gets the Signature validity period in seconds /// public int SignatureValidityPeriod { get; set; } diff --git a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache index 5ec833183d46..7b286d94d034 100644 --- a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache +++ b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache @@ -181,7 +181,7 @@ use function sprintf; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. {{/-first}} * URL: {{{url}}} {{#-last}} @@ -219,7 +219,7 @@ use function sprintf; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. {{/-first}} * URL: {{{url}}} {{#-last}} @@ -342,7 +342,7 @@ use function sprintf; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. {{/-first}} * URL: {{{url}}} {{#-last}} @@ -383,7 +383,7 @@ use function sprintf; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. {{/-first}} * URL: {{{url}}} {{#-last}} @@ -448,7 +448,7 @@ use function sprintf; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. {{/-first}} * URL: {{{url}}} {{#-last}} diff --git a/modules/openapi-generator/src/main/resources/r/api_client.mustache b/modules/openapi-generator/src/main/resources/r/api_client.mustache index b1844f4686b0..f37a60f25233 100644 --- a/modules/openapi-generator/src/main/resources/r/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/r/api_client.mustache @@ -29,7 +29,7 @@ {{#authMethods}} {{#isOAuth}} #' @field oauth_flow_type OAuth flow type -#' @field oauth_authorization_url Authoriziation URL +#' @field oauth_authorization_url authorization URL #' @field oauth_token_url Token URL #' @field oauth_pkce Boolean flag to enable PKCE {{/isOAuth}} @@ -73,7 +73,7 @@ ApiClient <- R6::R6Class( {{#isOAuth}} # Flow type oauth_flow_type = "{{flow}}", - # Authoriziation URL + # authorization URL oauth_authorization_url = "{{authorizationUrl}}", # Token URL oauth_token_url = "{{tokenUrl}}", @@ -105,7 +105,7 @@ ApiClient <- R6::R6Class( #' @param bearer_token Bearer token. #' @param timeout Timeout. #' @param retry_status_codes Status codes for retry. - #' @param max_retry_attempts Maxmium number of retry. + #' @param max_retry_attempts Maximum number of retry. #' @export initialize = function(base_path = NULL, user_agent = NULL, default_headers = NULL, diff --git a/modules/openapi-generator/src/main/resources/r/libraries/httr2/api_client.mustache b/modules/openapi-generator/src/main/resources/r/libraries/httr2/api_client.mustache index f2e95e679465..1cce5290ac99 100644 --- a/modules/openapi-generator/src/main/resources/r/libraries/httr2/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/r/libraries/httr2/api_client.mustache @@ -29,7 +29,7 @@ {{#authMethods}} {{#isOAuth}} #' @field oauth_flow_type OAuth flow type -#' @field oauth_authorization_url Authoriziation URL +#' @field oauth_authorization_url authorization URL #' @field oauth_token_url Token URL #' @field oauth_pkce Boolean flag to enable PKCE #' @field oauth_scopes OAuth scopes @@ -73,7 +73,7 @@ ApiClient <- R6::R6Class( {{#isOAuth}} # Flow type oauth_flow_type = "{{flow}}", - # Authoriziation URL + # authorization URL oauth_authorization_url = "{{authorizationUrl}}", # Token URL oauth_token_url = "{{tokenUrl}}", @@ -107,7 +107,7 @@ ApiClient <- R6::R6Class( #' @param bearer_token Bearer token. #' @param timeout Timeout. #' @param retry_status_codes Status codes for retry. - #' @param max_retry_attempts Maxmium number of retry. + #' @param max_retry_attempts Maximum number of retry. #' @export initialize = function(base_path = NULL, user_agent = NULL, default_headers = NULL, @@ -306,7 +306,7 @@ ApiClient <- R6::R6Class( req <- req %>% req_oauth_auth_code(client, scope = req_oauth_scopes, pkce = self$oauth_pkce, - auth_url = self$oauth_authoriziation_url) + auth_url = self$oauth_authorization_url) } {{/hasOAuthMethods}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/auth.mustache b/modules/openapi-generator/src/main/resources/rust-server/auth.mustache index cbaba3dca7c6..d2b1481eeb81 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/auth.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/auth.mustache @@ -34,7 +34,7 @@ fn dummy_authorization() -> Authorization { // However, if you want to use it anyway this can not be unimplemented, so dummy implementation added. // unimplemented!() Authorization{ - subject: "Dummmy".to_owned(), + subject: "Dummy".to_owned(), scopes: Scopes::Some(BTreeSet::new()), // create an empty scope, as this should not be used issuer: None } diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-request-body-multipart-form.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-request-body-multipart-form.mustache index c5022acf84bb..f563459396a8 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/server-request-body-multipart-form.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/server-request-body-multipart-form.mustache @@ -39,7 +39,7 @@ return Ok(Response::builder() .status(StatusCode::INTERNAL_SERVER_ERROR) .body(Body::from("Failed to process message part due an internal error".to_string())) - .expect("Unable to create Internal Server Error response due to an internal errror")) + .expect("Unable to create Internal Server Error response due to an internal error")) }, SaveResult::Error(e) => { return Ok(Response::builder() diff --git a/modules/openapi-generator/src/main/resources/xojo-client/README.mustache b/modules/openapi-generator/src/main/resources/xojo-client/README.mustache index 2853be362675..027695ee135e 100644 --- a/modules/openapi-generator/src/main/resources/xojo-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/xojo-client/README.mustache @@ -33,7 +33,7 @@ This project depends on [Xoson](https://github.com/Topheee/xoson) `v2.2.0` (and git clone 'https://github.com/Topheee/xoson.git' ``` -Open the `Xoson.xojo_project` from the cloned git repository with Xojo and copy the `Xoson` module to your project. Similarily, open the `{{{projectName}}}.xojo_project` file with Xojo and copy `{{{projectName}}}` to your project. +Open the `Xoson.xojo_project` from the cloned git repository with Xojo and copy the `Xoson` module to your project. Similarly, open the `{{{projectName}}}.xojo_project` file with Xojo and copy `{{{projectName}}}` to your project. > Since Xojo currently has no package manager, you need to manually copy both the `Xoson` and the `{{{projectName}}}` modules to your Xojo project. diff --git a/modules/openapi-generator/src/main/resources/zapier/authentication.mustache b/modules/openapi-generator/src/main/resources/zapier/authentication.mustache index 8294e5fc99a6..8a1bf2e76b5e 100644 --- a/modules/openapi-generator/src/main/resources/zapier/authentication.mustache +++ b/modules/openapi-generator/src/main/resources/zapier/authentication.mustache @@ -1,4 +1,4 @@ module.exports = { - // TODO: autentication logic + // TODO: authentication logic // https://platform.zapier.com/cli_tutorials/getting-started#adding-authentication }; \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java index 4e297f5b0af1..507d272c8e1e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java @@ -869,7 +869,7 @@ public void inheritanceWithInlineDiscriminator() { // Contact ComposedSchema contact = (ComposedSchema) openAPI.getComponents().getSchemas().get("Contact"); - Schema contactAllOf = contact.getAllOf().get(1); // use the inline child scheam directly + Schema contactAllOf = contact.getAllOf().get(1); // use the inline child schema directly assertEquals(contact.getExtensions().get("x-discriminator-value"), "contact"); assertEquals(contact.getAllOf().get(0).get$ref(), "#/components/schemas/Party"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java index 21f36c1ee6a9..8bed0f7382eb 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java @@ -99,7 +99,7 @@ public void testOpenAPINormalizerEnableKeepOnlyFirstTagInOperation() { @Test public void testOpenAPINormalizerRemoveAnyOfOneOfAndKeepPropertiesOnly() { - // to test the rule REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIIES_ONLY + // to test the rule REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/removeAnyOfOneOfAndKeepPropertiesOnly_test.yaml"); Schema schema = openAPI.getComponents().getSchemas().get("Person");