forked from loafle/openapi-generator-original
Document all used vendor extensions in specific generator (#11797)
This commit is contained in:
parent
be8567f656
commit
382e2a22a8
@ -61,6 +61,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -95,6 +95,16 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|virtualService|Generates the virtual service. For more details refer - https://github.com/virtualansoftware/virtualan/wiki| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|x-spring-paginated|Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters|OPERATION|false
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -63,6 +63,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -69,6 +69,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useBeanValidation|Use BeanValidation API annotations| |true|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -71,6 +71,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useBeanValidation|Use BeanValidation API annotations| |true|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -69,6 +69,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useTags|use tags for creating interface and controller classnames| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -70,6 +70,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|zipkinUri|Zipkin URI| |null|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -73,6 +73,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|wrapCalls|Add a wrapper to each controller function to handle things like metrics, response modification, etc..| |true|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -63,6 +63,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -63,6 +63,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -66,6 +66,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|vertxSwaggerRouterVersion|Specify the version of the swagger router library| |null|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -84,6 +84,16 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|x-webclient-blocking|Specifies if method for specific operation should be blocking or non-blocking(ex: return `Mono<T>/Flux<T>` or `return T/List<T>/Set<T>` & execute `.block()` inside generated method)|OPERATION|false
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -76,6 +76,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useTags|use tags for creating interface and controller classnames| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -67,6 +67,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useLoggingFeatureForTests|Use Logging Feature for tests| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -90,6 +90,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useWadlFeature|Use WADL Feature| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -85,6 +85,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useWadlFeature|Use WADL Feature| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -70,6 +70,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useTags|use tags for creating interface and controller classnames| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -70,6 +70,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useTags|use tags for creating interface and controller classnames| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -69,6 +69,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useTags|use tags for creating interface and controller classnames| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -76,6 +76,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useTags|use tags for creating interface and controller classnames| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -88,6 +88,16 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|virtualService|Generates the virtual service. For more details refer - https://github.com/virtualansoftware/virtualan/wiki| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|x-spring-paginated|Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters|OPERATION|false
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
|
@ -24,6 +24,7 @@ import org.openapitools.codegen.CliOption;
|
||||
import org.openapitools.codegen.CodegenConfig;
|
||||
import org.openapitools.codegen.CodegenConfigLoader;
|
||||
import org.openapitools.codegen.GeneratorNotFoundException;
|
||||
import org.openapitools.codegen.VendorExtension;
|
||||
import org.openapitools.codegen.meta.FeatureSet;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -89,6 +90,10 @@ public class ConfigHelp extends OpenApiGeneratorCommand {
|
||||
"--markdown-header"}, title = "markdown header", description = "When format=markdown, include this option to write out markdown headers (e.g. for docusaurus).")
|
||||
private Boolean markdownHeader;
|
||||
|
||||
@Option(name = {
|
||||
"--supported-vendor-extensions"}, title = "supported vendor extensions", description = "List supported vendor extensions")
|
||||
private Boolean supportedVendorExtensions;
|
||||
|
||||
@Option(name = {"--full-details"}, title = "full generator details", description = "displays CLI options as well as other configs/mappings (implies --instantiation-types, --reserved-words, --language-specific-primitives, --import-mappings, --feature-set)")
|
||||
private Boolean fullDetails;
|
||||
|
||||
@ -108,6 +113,7 @@ public class ConfigHelp extends OpenApiGeneratorCommand {
|
||||
importMappings = Boolean.TRUE;
|
||||
featureSets = Boolean.TRUE;
|
||||
metadata = Boolean.TRUE;
|
||||
supportedVendorExtensions = Boolean.TRUE;
|
||||
}
|
||||
|
||||
try {
|
||||
@ -198,6 +204,27 @@ public class ConfigHelp extends OpenApiGeneratorCommand {
|
||||
});
|
||||
}
|
||||
|
||||
private void generateMdSupportedVendorExtensions(StringBuilder sb, CodegenConfig config) {
|
||||
List<VendorExtension> supportedVendorExtensions = config.getSupportedVendorExtensions();
|
||||
if (supportedVendorExtensions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
sb
|
||||
.append(newline).append("## SUPPORTED VENDOR EXTENSIONS").append(newline).append(newline)
|
||||
.append("| Extension name | Description | Applicable for | Default value |").append(newline)
|
||||
.append("| -------------- | ----------- | -------------- | ------------- |").append(newline);
|
||||
|
||||
supportedVendorExtensions.forEach(
|
||||
extension -> sb.append("|").append(extension.getName())
|
||||
.append("|").append(extension.getDescription())
|
||||
.append("|").append(extension.getLevels().stream().map(Objects::toString).collect(Collectors.joining(", ")))
|
||||
.append("|").append(extension.getDefaultValue())
|
||||
.append(newline)
|
||||
);
|
||||
sb.append(newline);
|
||||
}
|
||||
|
||||
private void generateMdImportMappings(StringBuilder sb, CodegenConfig config) {
|
||||
sb.append(newline).append("## IMPORT MAPPING").append(newline).append(newline);
|
||||
|
||||
@ -332,6 +359,10 @@ public class ConfigHelp extends OpenApiGeneratorCommand {
|
||||
generateMdConfigOptionsHeader(sb, config);
|
||||
generateMdConfigOptions(sb, config);
|
||||
|
||||
if (Boolean.TRUE.equals(supportedVendorExtensions)) {
|
||||
generateMdSupportedVendorExtensions(sb, config);
|
||||
}
|
||||
|
||||
if (Boolean.TRUE.equals(importMappings)) {
|
||||
generateMdImportMappings(sb, config);
|
||||
}
|
||||
|
@ -305,13 +305,15 @@ public interface CodegenConfig {
|
||||
|
||||
Schema unaliasSchema(Schema schema, Map<String, String> usedImportMappings);
|
||||
|
||||
public String defaultTemplatingEngine();
|
||||
String defaultTemplatingEngine();
|
||||
|
||||
public GeneratorLanguage generatorLanguage();
|
||||
GeneratorLanguage generatorLanguage();
|
||||
|
||||
/*
|
||||
the version of the language that the generator implements
|
||||
For python 3.9.0, generatorLanguageVersion would be "3.9.0"
|
||||
*/
|
||||
public String generatorLanguageVersion();
|
||||
String generatorLanguageVersion();
|
||||
|
||||
List<VendorExtension> getSupportedVendorExtensions();
|
||||
}
|
||||
|
@ -7407,5 +7407,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
return null;
|
||||
}
|
||||
|
||||
;
|
||||
@Override
|
||||
public List<VendorExtension> getSupportedVendorExtensions() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,53 @@
|
||||
package org.openapitools.codegen;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public enum VendorExtension {
|
||||
|
||||
X_IMPLEMENTS("x-implements", ExtensionLevel.MODEL, "Ability to specify interfaces that model must implements", "empty array"),
|
||||
X_SPRING_PAGINATED("x-spring-paginated", ExtensionLevel.OPERATION, "Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters", "false"),
|
||||
X_DISCRIMINATOR_VALUE("x-discriminator-value", ExtensionLevel.MODEL, "Used with model inheritance to specify value for discriminator that identifies current model", ""),
|
||||
X_SETTER_EXTRA_ANNOTATION("x-setter-extra-annotation", ExtensionLevel.FIELD, "Custom annotation that can be specified over java setter for specific field", "When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value"),
|
||||
X_WEBCLIENT_BLOCKING("x-webclient-blocking", ExtensionLevel.OPERATION, "Specifies if method for specific operation should be blocking or non-blocking(ex: return `Mono<T>/Flux<T>` or `return T/List<T>/Set<T>` & execute `.block()` inside generated method)", "false")
|
||||
;
|
||||
|
||||
private final String name;
|
||||
private final List<ExtensionLevel> levels;
|
||||
private final String description;
|
||||
private final String defaultValue;
|
||||
|
||||
VendorExtension(final String name, final List<ExtensionLevel> levels, final String description, final String defaultValue) {
|
||||
this.name = name;
|
||||
this.levels = levels;
|
||||
this.description = description;
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
VendorExtension(final String name, final ExtensionLevel level, final String description, final String defaultValue) {
|
||||
this(name, Collections.singletonList(level), description, defaultValue);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<ExtensionLevel> getLevels() {
|
||||
return levels;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public enum ExtensionLevel {
|
||||
FIELD,
|
||||
MODEL,
|
||||
OPERATION
|
||||
}
|
||||
|
||||
}
|
@ -2002,4 +2002,12 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VendorExtension> getSupportedVendorExtensions() {
|
||||
List<VendorExtension> extensions = super.getSupportedVendorExtensions();
|
||||
extensions.add(VendorExtension.X_DISCRIMINATOR_VALUE);
|
||||
extensions.add(VendorExtension.X_IMPLEMENTS);
|
||||
extensions.add(VendorExtension.X_SETTER_EXTRA_ANNOTATION);
|
||||
return extensions;
|
||||
}
|
||||
}
|
||||
|
@ -1059,4 +1059,11 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VendorExtension> getSupportedVendorExtensions() {
|
||||
List<VendorExtension> extensions = super.getSupportedVendorExtensions();
|
||||
extensions.add(VendorExtension.X_WEBCLIENT_BLOCKING);
|
||||
return extensions;
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ import org.openapitools.codegen.CodegenResponse;
|
||||
import org.openapitools.codegen.CodegenSecurity;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.VendorExtension;
|
||||
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
|
||||
import org.openapitools.codegen.languages.features.DocumentationProviderFeatures;
|
||||
import org.openapitools.codegen.languages.features.OptionalFeatures;
|
||||
@ -983,4 +984,11 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
public void setUseSwaggerUI(boolean useSwaggerUI) {
|
||||
this.useSwaggerUI = useSwaggerUI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VendorExtension> getSupportedVendorExtensions() {
|
||||
List<VendorExtension> extensions = super.getSupportedVendorExtensions();
|
||||
extensions.add(VendorExtension.X_SPRING_PAGINATED);
|
||||
return extensions;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user