diff --git a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CommonItemConfig.java b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CommonItemConfig.java index 487403b55..f0fffc0a6 100644 --- a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CommonItemConfig.java +++ b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CommonItemConfig.java @@ -177,4 +177,10 @@ public interface CommonItemConfig { */ @WithName("equals-hashcode") Optional equalsHashcode(); + + /** + * Add additional properties as attribute. + */ + @WithName("additional-properties-as-attribute") + Optional additionalPropertiesAsAttribute(); } diff --git a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/SpecItemConfig.java b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/SpecItemConfig.java index bffb801fd..32ae2f30b 100644 --- a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/SpecItemConfig.java +++ b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/SpecItemConfig.java @@ -19,6 +19,12 @@ public interface SpecItemConfig extends CommonItemConfig { @WithName("base-package") Optional basePackage(); + /** + * Custom config key to use in place of the openapi spec file + */ + @WithName("config-key") + Optional configKey(); + /** * Suffix name for generated api classes */ @@ -55,4 +61,11 @@ public interface SpecItemConfig extends CommonItemConfig { */ @WithName("remove-operation-id-prefix-count") Optional removeOperationIdPrefixCount(); + + /** + * Set serializable model + */ + @WithName("serializable-model") + Optional serializableModel(); + } diff --git a/client/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/codestart.yml b/client/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/codestart.yml index cc83535aa..29eabb85d 100644 --- a/client/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/codestart.yml +++ b/client/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/codestart.yml @@ -3,6 +3,6 @@ ref: openapi-generator type: code tags: extension-codestart metadata: - title: OpenAPI Generator Codestart - description: Start to code with the OpenAPI Generator extension. - related-guide-section: https://docs.quarkiverse.io/quarkus-openapi-generator/dev/index.html \ No newline at end of file + title: OpenAPI Generator Client Codestart + description: Start to code with the OpenAPI Generator Client extension. + related-guide-section: https://docs.quarkiverse.io/quarkus-openapi-generator/dev/client.html \ No newline at end of file diff --git a/client/runtime/src/main/java/io/quarkiverse/openapi/generator/AuthConfig.java b/client/runtime/src/main/java/io/quarkiverse/openapi/generator/AuthConfig.java index 5a1e57987..0169d1524 100644 --- a/client/runtime/src/main/java/io/quarkiverse/openapi/generator/AuthConfig.java +++ b/client/runtime/src/main/java/io/quarkiverse/openapi/generator/AuthConfig.java @@ -1,23 +1,18 @@ package io.quarkiverse.openapi.generator; -import java.util.Map; import java.util.Optional; -import io.quarkiverse.openapi.generator.providers.ApiKeyAuthenticationProvider; -import io.quarkiverse.openapi.generator.providers.BasicAuthenticationProvider; -import io.quarkiverse.openapi.generator.providers.BearerAuthenticationProvider; import io.quarkus.runtime.annotations.ConfigGroup; -import io.quarkus.runtime.annotations.ConfigItem; /** * This class represents the runtime authentication related configuration for an individual securityScheme present * on an OpenApi spec definition, i.e. the provided files. */ @ConfigGroup -public class AuthConfig { +public interface AuthConfig { - public static final String TOKEN_PROPAGATION = "token-propagation"; - public static final String HEADER_NAME = "header-name"; + String TOKEN_PROPAGATION = "token-propagation"; + String HEADER_NAME = "header-name"; /** * Enables the authentication token propagation for this particular securityScheme. @@ -31,8 +26,7 @@ public class AuthConfig { * @see SpecItemConfig * @see OpenApiGeneratorConfig */ - @ConfigItem(defaultValue = "false") - public Optional tokenPropagation; + Optional tokenPropagation(); /** * Configures a particular http header attribute from were to take the security token from when the token propagation @@ -47,48 +41,91 @@ public class AuthConfig { * @see SpecItemConfig * @see OpenApiGeneratorConfig */ - @ConfigItem - public Optional headerName; + Optional headerName(); /** - * Configures a particular parameter value to be used by any of the different internal authentication filters - * that processes the different securityScheme definitions. - *

+ * Sets the Basic Authentication username for a given OpenAPI securityScheme. + *

* For example, given a file named petstore.json with a securityScheme named "petstore-basic-auth", that is of - * http basic authentication type, the following configuration can establish the user and password to be used. - * must be used. - *

+ * http basic authentication type, the following configuration can establish the user to be used. + *

* quarkus.openapi-generator.petstore_json.auth.petstore_basic_auth.username=MyUserName - * quarkus.openapi-generator.petstore_json.auth.petstore_basic_auth.password=MyPassword * - * @see AuthsConfig - * @see SpecItemConfig - * @see OpenApiGeneratorConfig - * @see BasicAuthenticationProvider - * @see BearerAuthenticationProvider - * @see ApiKeyAuthenticationProvider + * @return the username portion for Basic Authentication + * @see AuthConfig#password() + * @see 4.8.27.2.1 Basic Authentication + * Sample */ - @ConfigItem(name = ConfigItem.PARENT) - public Map authConfigParams; + Optional username(); - public Optional getTokenPropagation() { - return tokenPropagation; - } + /** + * Sets the Basic Authentication password for a given OpenAPI securityScheme. + *

+ * For example, given a file named petstore.json with a securityScheme named "petstore-basic-auth", that is of + * http basic authentication type, the following configuration can establish the password to be used. + *

+ * quarkus.openapi-generator.petstore_json.auth.petstore_basic_auth.password=MyPassword + *

+ * Ignored if the given securityScheme is not Basic Authentication + * + * @return the password portion for Basic Authentication + * @see AuthConfig#username() + * @see 4.8.27.2.1 Basic Authentication + * Sample + */ + Optional password(); - public Optional getHeaderName() { - return headerName; - } + /** + * Sets the Bearer Token for a given OpenAPI securityScheme. + *

+ * For example, given a file named petstore.json with a securityScheme named "petstore-bearer-auth", that is of + * bearer authentication type, the following configuration can establish the token to be used. + *

+ * quarkus.openapi-generator.petstore_json.auth.petstore_bearer_auth.token=1234567890 + *

+ * Ignored if the given securityScheme is not Bearer Token Authentication + * + * @return the token + * @see 4.8.27.2.3 JWT Bearer Sample + */ + Optional bearerToken(); - public Optional getConfigParam(String paramName) { - return Optional.ofNullable(authConfigParams.get(paramName)); - } + /** + * Sets the API Key for a given OpenAPI securityScheme. + *

+ * For example, given a file named petstore.json with a securityScheme named "petstore-apikey-auth", that is of + * API Key authentication type, the following configuration can establish the API Key to be used. + *

+ * quarkus.openapi-generator.petstore_json.auth.petstore_apikey_auth.api-key=${MY_SECRET_KEY_IN_AN_ENV_VAR} + *

+ * Ignored if the given securityScheme is not API Key Authentication + * + * @return the token + * @see 4.8.27.2.2 API Key Samplee + */ + Optional apiKey(); - @Override - public String toString() { - return "AuthConfig{" + - "tokenPropagation=" + tokenPropagation + - ", headerName=" + headerName + - ", authConfigParams=" + authConfigParams + - '}'; - } + /** + * Only valid for API Key Authentication. + *

+ * When to add the `Authorization` value to the API Key in the authentication header. + *

+ * For example, if this property is set to `true`, the API Key will be sent to the server in the header along with + * `Authorization`: + *

+ * [source] + * --- + * Authentication: Authorization MY-API-KEY + * --- + *

+ * If set to `false`, the header should be: + *

+ * [source] + * --- + * Authentication: MY-API-KEY + * --- + * + * @return whether to use the prefix `Authorization` when sending an API Key using headers. + */ + Optional useAuthorizationHeaderValue(); } diff --git a/docs/modules/ROOT/pages/includes/quarkus-openapi-generator.adoc b/docs/modules/ROOT/pages/includes/quarkus-openapi-generator.adoc index 4e1262425..bcb8f8e72 100644 --- a/docs/modules/ROOT/pages/includes/quarkus-openapi-generator.adoc +++ b/docs/modules/ROOT/pages/includes/quarkus-openapi-generator.adoc @@ -454,6 +454,27 @@ endif::add-copy-button-to-env-var[] |boolean | +a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-additional-properties-as-attribute]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-additional-properties-as-attribute[`quarkus.openapi-generator.codegen.additional-properties-as-attribute`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator.codegen.additional-properties-as-attribute+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Add additional properties as attribute. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_ADDITIONAL_PROPERTIES_AS_ATTRIBUTE+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_ADDITIONAL_PROPERTIES_AS_ATTRIBUTE+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-verbose]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-verbose[`quarkus.openapi-generator.codegen.verbose`]## ifdef::add-copy-button-to-config-props[] config_property_copy_button:+++quarkus.openapi-generator.codegen.verbose+++[] @@ -1048,6 +1069,27 @@ endif::add-copy-button-to-env-var[] |boolean | +a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-additional-properties-as-attribute]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-additional-properties-as-attribute[`quarkus.openapi-generator.codegen.spec."spec-item".additional-properties-as-attribute`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator.codegen.spec."spec-item".additional-properties-as-attribute+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Add additional properties as attribute. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_SPEC__SPEC_ITEM__ADDITIONAL_PROPERTIES_AS_ATTRIBUTE+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_SPEC__SPEC_ITEM__ADDITIONAL_PROPERTIES_AS_ATTRIBUTE+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-base-package]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-base-package[`quarkus.openapi-generator.codegen.spec."spec-item".base-package`]## ifdef::add-copy-button-to-config-props[] config_property_copy_button:+++quarkus.openapi-generator.codegen.spec."spec-item".base-package+++[] @@ -1069,6 +1111,27 @@ endif::add-copy-button-to-env-var[] |string | +a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-config-key]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-config-key[`quarkus.openapi-generator.codegen.spec."spec-item".config-key`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator.codegen.spec."spec-item".config-key+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Custom config key to use in place of the openapi spec file + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_SPEC__SPEC_ITEM__CONFIG_KEY+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_SPEC__SPEC_ITEM__CONFIG_KEY+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-api-name-suffix]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-api-name-suffix[`quarkus.openapi-generator.codegen.spec."spec-item".api-name-suffix`]## ifdef::add-copy-button-to-config-props[] config_property_copy_button:+++quarkus.openapi-generator.codegen.spec."spec-item".api-name-suffix+++[] @@ -1195,5 +1258,213 @@ endif::add-copy-button-to-env-var[] |int | +a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-serializable-model]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-serializable-model[`quarkus.openapi-generator.codegen.spec."spec-item".serializable-model`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator.codegen.spec."spec-item".serializable-model+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Set serializable model + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_SPEC__SPEC_ITEM__SERIALIZABLE_MODEL+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_SPEC__SPEC_ITEM__SERIALIZABLE_MODEL+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-token-propagation]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-token-propagation[`quarkus.openapi-generator."item-configs".auth."auth-configs".token-propagation`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".token-propagation+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Enables the authentication token propagation for this particular securityScheme. + +For example, given a file named petstore.json with a securityScheme named "petstore-auth" the following configuration must be used. + +quarkus.openapi-generator.petstore_json.auth.petstore_auth.token-propagation=true + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__TOKEN_PROPAGATION+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__TOKEN_PROPAGATION+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-header-name]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-header-name[`quarkus.openapi-generator."item-configs".auth."auth-configs".header-name`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".header-name+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Configures a particular http header attribute from were to take the security token from when the token propagation is enabled. Use this fine-grained configuration in very particular scenarios. + +For example, given a file named petstore.json with a securityScheme named "petstore-auth" the following configuration must be used. + +quarkus.openapi-generator.petstore_json.auth.petstore_auth.header-name=MyParticularHttpHeaderName + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__HEADER_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__HEADER_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-username]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-username[`quarkus.openapi-generator."item-configs".auth."auth-configs".username`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".username+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Sets the Basic Authentication username for a given OpenAPI securityScheme. + +For example, given a file named petstore.json with a securityScheme named "petstore-basic-auth", that is of http basic authentication type, the following configuration can establish the user to be used. + +quarkus.openapi-generator.petstore_json.auth.petstore_basic_auth.username=MyUserName + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__USERNAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__USERNAME+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-password]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-password[`quarkus.openapi-generator."item-configs".auth."auth-configs".password`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".password+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Sets the Basic Authentication password for a given OpenAPI securityScheme. + +For example, given a file named petstore.json with a securityScheme named "petstore-basic-auth", that is of http basic authentication type, the following configuration can establish the password to be used. + +quarkus.openapi-generator.petstore_json.auth.petstore_basic_auth.password=MyPassword + +Ignored if the given securityScheme is not Basic Authentication + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__PASSWORD+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__PASSWORD+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-bearer-token]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-bearer-token[`quarkus.openapi-generator."item-configs".auth."auth-configs".bearer-token`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".bearer-token+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Sets the Bearer Token for a given OpenAPI securityScheme. + +For example, given a file named petstore.json with a securityScheme named "petstore-bearer-auth", that is of bearer authentication type, the following configuration can establish the token to be used. + +quarkus.openapi-generator.petstore_json.auth.petstore_bearer_auth.token=1234567890 + +Ignored if the given securityScheme is not Bearer Token Authentication + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__BEARER_TOKEN+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__BEARER_TOKEN+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-api-key]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-api-key[`quarkus.openapi-generator."item-configs".auth."auth-configs".api-key`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".api-key+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Sets the API Key for a given OpenAPI securityScheme. + +For example, given a file named petstore.json with a securityScheme named "petstore-apikey-auth", that is of API Key authentication type, the following configuration can establish the API Key to be used. + +quarkus.openapi-generator.petstore_json.auth.petstore_apikey_auth.api-key=$++{++MY_SECRET_KEY_IN_AN_ENV_VAR++}++ + +Ignored if the given securityScheme is not API Key Authentication + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__API_KEY+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__API_KEY+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-use-authorization-header-value]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-use-authorization-header-value[`quarkus.openapi-generator."item-configs".auth."auth-configs".use-authorization-header-value`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".use-authorization-header-value+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Only valid for API Key Authentication. + +When to add the `Authorization` value to the API Key in the authentication header. + +For example, if this property is set to `true`, the API Key will be sent to the server in the header along with `Authorization`: + +++[++source++]++ --- Authentication: Authorization MY-API-KEY --- + +If set to `false`, the header should be: + +++[++source++]++ --- Authentication: MY-API-KEY --- + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__USE_AUTHORIZATION_HEADER_VALUE+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__USE_AUTHORIZATION_HEADER_VALUE+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +| + |=== diff --git a/docs/modules/ROOT/pages/includes/quarkus-openapi-generator_quarkus.openapi-generator.adoc b/docs/modules/ROOT/pages/includes/quarkus-openapi-generator_quarkus.openapi-generator.adoc index 4e1262425..bcb8f8e72 100644 --- a/docs/modules/ROOT/pages/includes/quarkus-openapi-generator_quarkus.openapi-generator.adoc +++ b/docs/modules/ROOT/pages/includes/quarkus-openapi-generator_quarkus.openapi-generator.adoc @@ -454,6 +454,27 @@ endif::add-copy-button-to-env-var[] |boolean | +a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-additional-properties-as-attribute]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-additional-properties-as-attribute[`quarkus.openapi-generator.codegen.additional-properties-as-attribute`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator.codegen.additional-properties-as-attribute+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Add additional properties as attribute. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_ADDITIONAL_PROPERTIES_AS_ATTRIBUTE+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_ADDITIONAL_PROPERTIES_AS_ATTRIBUTE+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-verbose]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-verbose[`quarkus.openapi-generator.codegen.verbose`]## ifdef::add-copy-button-to-config-props[] config_property_copy_button:+++quarkus.openapi-generator.codegen.verbose+++[] @@ -1048,6 +1069,27 @@ endif::add-copy-button-to-env-var[] |boolean | +a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-additional-properties-as-attribute]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-additional-properties-as-attribute[`quarkus.openapi-generator.codegen.spec."spec-item".additional-properties-as-attribute`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator.codegen.spec."spec-item".additional-properties-as-attribute+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Add additional properties as attribute. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_SPEC__SPEC_ITEM__ADDITIONAL_PROPERTIES_AS_ATTRIBUTE+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_SPEC__SPEC_ITEM__ADDITIONAL_PROPERTIES_AS_ATTRIBUTE+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-base-package]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-base-package[`quarkus.openapi-generator.codegen.spec."spec-item".base-package`]## ifdef::add-copy-button-to-config-props[] config_property_copy_button:+++quarkus.openapi-generator.codegen.spec."spec-item".base-package+++[] @@ -1069,6 +1111,27 @@ endif::add-copy-button-to-env-var[] |string | +a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-config-key]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-config-key[`quarkus.openapi-generator.codegen.spec."spec-item".config-key`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator.codegen.spec."spec-item".config-key+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Custom config key to use in place of the openapi spec file + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_SPEC__SPEC_ITEM__CONFIG_KEY+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_SPEC__SPEC_ITEM__CONFIG_KEY+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-api-name-suffix]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-api-name-suffix[`quarkus.openapi-generator.codegen.spec."spec-item".api-name-suffix`]## ifdef::add-copy-button-to-config-props[] config_property_copy_button:+++quarkus.openapi-generator.codegen.spec."spec-item".api-name-suffix+++[] @@ -1195,5 +1258,213 @@ endif::add-copy-button-to-env-var[] |int | +a|icon:lock[title=Fixed at build time] [[quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-serializable-model]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-codegen-spec-spec-item-serializable-model[`quarkus.openapi-generator.codegen.spec."spec-item".serializable-model`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator.codegen.spec."spec-item".serializable-model+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Set serializable model + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_SPEC__SPEC_ITEM__SERIALIZABLE_MODEL+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR_CODEGEN_SPEC__SPEC_ITEM__SERIALIZABLE_MODEL+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-token-propagation]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-token-propagation[`quarkus.openapi-generator."item-configs".auth."auth-configs".token-propagation`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".token-propagation+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Enables the authentication token propagation for this particular securityScheme. + +For example, given a file named petstore.json with a securityScheme named "petstore-auth" the following configuration must be used. + +quarkus.openapi-generator.petstore_json.auth.petstore_auth.token-propagation=true + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__TOKEN_PROPAGATION+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__TOKEN_PROPAGATION+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-header-name]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-header-name[`quarkus.openapi-generator."item-configs".auth."auth-configs".header-name`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".header-name+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Configures a particular http header attribute from were to take the security token from when the token propagation is enabled. Use this fine-grained configuration in very particular scenarios. + +For example, given a file named petstore.json with a securityScheme named "petstore-auth" the following configuration must be used. + +quarkus.openapi-generator.petstore_json.auth.petstore_auth.header-name=MyParticularHttpHeaderName + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__HEADER_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__HEADER_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-username]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-username[`quarkus.openapi-generator."item-configs".auth."auth-configs".username`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".username+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Sets the Basic Authentication username for a given OpenAPI securityScheme. + +For example, given a file named petstore.json with a securityScheme named "petstore-basic-auth", that is of http basic authentication type, the following configuration can establish the user to be used. + +quarkus.openapi-generator.petstore_json.auth.petstore_basic_auth.username=MyUserName + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__USERNAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__USERNAME+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-password]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-password[`quarkus.openapi-generator."item-configs".auth."auth-configs".password`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".password+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Sets the Basic Authentication password for a given OpenAPI securityScheme. + +For example, given a file named petstore.json with a securityScheme named "petstore-basic-auth", that is of http basic authentication type, the following configuration can establish the password to be used. + +quarkus.openapi-generator.petstore_json.auth.petstore_basic_auth.password=MyPassword + +Ignored if the given securityScheme is not Basic Authentication + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__PASSWORD+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__PASSWORD+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-bearer-token]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-bearer-token[`quarkus.openapi-generator."item-configs".auth."auth-configs".bearer-token`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".bearer-token+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Sets the Bearer Token for a given OpenAPI securityScheme. + +For example, given a file named petstore.json with a securityScheme named "petstore-bearer-auth", that is of bearer authentication type, the following configuration can establish the token to be used. + +quarkus.openapi-generator.petstore_json.auth.petstore_bearer_auth.token=1234567890 + +Ignored if the given securityScheme is not Bearer Token Authentication + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__BEARER_TOKEN+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__BEARER_TOKEN+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-api-key]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-api-key[`quarkus.openapi-generator."item-configs".auth."auth-configs".api-key`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".api-key+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Sets the API Key for a given OpenAPI securityScheme. + +For example, given a file named petstore.json with a securityScheme named "petstore-apikey-auth", that is of API Key authentication type, the following configuration can establish the API Key to be used. + +quarkus.openapi-generator.petstore_json.auth.petstore_apikey_auth.api-key=$++{++MY_SECRET_KEY_IN_AN_ENV_VAR++}++ + +Ignored if the given securityScheme is not API Key Authentication + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__API_KEY+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__API_KEY+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-use-authorization-header-value]] [.property-path]##link:#quarkus-openapi-generator_quarkus-openapi-generator-item-configs-auth-auth-configs-use-authorization-header-value[`quarkus.openapi-generator."item-configs".auth."auth-configs".use-authorization-header-value`]## +ifdef::add-copy-button-to-config-props[] +config_property_copy_button:+++quarkus.openapi-generator."item-configs".auth."auth-configs".use-authorization-header-value+++[] +endif::add-copy-button-to-config-props[] + + +[.description] +-- +Only valid for API Key Authentication. + +When to add the `Authorization` value to the API Key in the authentication header. + +For example, if this property is set to `true`, the API Key will be sent to the server in the header along with `Authorization`: + +++[++source++]++ --- Authentication: Authorization MY-API-KEY --- + +If set to `false`, the header should be: + +++[++source++]++ --- Authentication: MY-API-KEY --- + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__USE_AUTHORIZATION_HEADER_VALUE+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_OPENAPI_GENERATOR__ITEM_CONFIGS__AUTH__AUTH_CONFIGS__USE_AUTHORIZATION_HEADER_VALUE+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +| + |===