-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable-security-generation | additional-api-type-annotations (#431)
* enable-security-generation | additional-api-type-annotations * removal of custom-register-providers and client-headers-factory * documentation | fixes * Update README.md Co-authored-by: Helber Belmiro <helber.belmiro@gmail.com> * global configs | fixes * config name validation | default-security-schema | refactor * fixes * OpenApiConfigValidator * config items refactor * Update deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/codegen/OpenApiConfigValidator.java Co-authored-by: Helber Belmiro <helber.belmiro@gmail.com> * Update deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/codegen/OpenApiGeneratorCodeGenBase.java Co-authored-by: Helber Belmiro <helber.belmiro@gmail.com> * Update deployment/src/test/java/io/quarkiverse/openapi/generator/deployment/OpenApiConfigValidatorTest.java Co-authored-by: Helber Belmiro <helber.belmiro@gmail.com> * last fixes * switch default values * token propagation factory --------- Co-authored-by: Helber Belmiro <helber.belmiro@gmail.com> Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
- Loading branch information
1 parent
a9f5b84
commit 927dcd7
Showing
33 changed files
with
510 additions
and
1,403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CommonItemConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package io.quarkiverse.openapi.generator.deployment; | ||
|
||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
|
||
/* | ||
* Model for the configuration of this extension. | ||
* It's used for documentation purposes only. | ||
* The configuration is consumed in the codegen phase, before build time. | ||
* Not meant to be used outside this scope. | ||
* Config items can be applied on spec and globally as well | ||
*/ | ||
@ConfigGroup | ||
public class CommonItemConfig { | ||
|
||
/** | ||
* Whether to skip the generation of models for form parameters | ||
*/ | ||
@ConfigItem(name = "skip-form-model") | ||
public Optional<Boolean> skipFormModel; | ||
|
||
/** | ||
* Type Mapping is an OpenAPI Generator configuration specifying which Java types (the values) should be used for a | ||
* given OAS datatype (the keys of this map) | ||
*/ | ||
@ConfigItem(name = "type-mappings") | ||
public Map<String, String> typeMappings; | ||
|
||
/** | ||
* Import Mapping is an OpenAPI Generator configuration specifying which Java types (the values) should be | ||
* imported when a given OAS datatype (the keys of this map) is used | ||
*/ | ||
@ConfigItem(name = "import-mappings") | ||
public Map<String, String> importMappings; | ||
|
||
/** | ||
* The specified annotations will be added to the generated model files | ||
*/ | ||
@ConfigItem(name = "additional-model-type-annotations") | ||
public Optional<String> additionalModelTypeAnnotations; | ||
|
||
/** | ||
* The specified annotations will be added to the generated api files | ||
*/ | ||
@ConfigItem(name = "additional-api-type-annotations") | ||
public Optional<String> additionalApiTypeAnnotations; | ||
|
||
/** | ||
* Defines if the methods should return {@link jakarta.ws.rs.core.Response} or a model. Default is <code>false</code>. | ||
*/ | ||
@ConfigItem(name = "return-response") | ||
public Optional<Boolean> returnResponse; | ||
|
||
/** | ||
* Defines if security support classes should be generated | ||
*/ | ||
@ConfigItem(name = "enable-security-generation") | ||
public Optional<String> enableSecurityGeneration; | ||
|
||
/** | ||
* Defines the normalizer options. | ||
*/ | ||
@ConfigItem(name = "open-api-normalizer") | ||
public Map<String, String> normalizer; | ||
|
||
/** | ||
* Enable SmallRye Mutiny support. If you set this to `true`, all return types will be wrapped in `io.smallrye.mutiny.Uni`. | ||
*/ | ||
@ConfigItem(name = "mutiny") | ||
public Optional<Boolean> supportMutiny; | ||
} |
55 changes: 55 additions & 0 deletions
55
...oyment/src/main/java/io/quarkiverse/openapi/generator/deployment/GlobalCodegenConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package io.quarkiverse.openapi.generator.deployment; | ||
|
||
import java.util.Optional; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
|
||
/* | ||
* Model for the configuration of this extension. | ||
* It's used for documentation purposes only. | ||
* The configuration is consumed in the codegen phase, before build time. | ||
* Not meant to be used outside this scope. | ||
* Config items can be applied only globally | ||
*/ | ||
@ConfigGroup | ||
public class GlobalCodegenConfig extends CommonItemConfig { | ||
|
||
/** | ||
* Whether to log the internal generator codegen process in the default output or not. | ||
*/ | ||
@ConfigItem(name = "verbose", defaultValue = "false") | ||
public boolean verbose; | ||
|
||
/** | ||
* Option to change the directory where OpenAPI files must be found. | ||
*/ | ||
@ConfigItem(name = "input-base-dir") | ||
public Optional<String> inputBaseDir; | ||
|
||
/** | ||
* Whether or not to skip validating the input spec prior to generation. By default, invalid specifications will result in | ||
* an error. | ||
*/ | ||
@ConfigItem(name = "validateSpec", defaultValue = "true") | ||
public boolean validateSpec; | ||
|
||
/** | ||
* Option to specify files for which generation should be executed only | ||
*/ | ||
@ConfigItem(name = "include") | ||
public Optional<String> include; | ||
|
||
/** | ||
* Option to exclude file from generation | ||
*/ | ||
@ConfigItem(name = "exclude") | ||
public Optional<String> exclude; | ||
|
||
/** | ||
* Create security for the referenced security scheme | ||
*/ | ||
@ConfigItem(name = "default-security-scheme") | ||
public Optional<String> defaultSecuritySchema; | ||
|
||
} |
Oops, something went wrong.