From 11cd890ab2903ff098f15318ad4bdb24374ad4d0 Mon Sep 17 00:00:00 2001 From: likwei Date: Fri, 15 Nov 2019 18:09:27 +0800 Subject: [PATCH 1/2] implement #4491 add cli option to ignore anyOf in enum --- .../languages/AbstractJavaCodegen.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index eb4ed1e9164b..43d1ea54ea3e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -22,6 +22,7 @@ import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.oas.models.servers.Server; @@ -37,6 +38,7 @@ import java.io.File; import java.util.*; import java.util.regex.Pattern; +import java.util.stream.Stream; import static org.openapitools.codegen.utils.StringUtils.*; @@ -54,6 +56,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public static final String SUPPORT_JAVA6 = "supportJava6"; public static final String DISABLE_HTML_ESCAPING = "disableHtmlEscaping"; public static final String BOOLEAN_GETTER_PREFIX = "booleanGetterPrefix"; + public static final String IGNORE_ANYOF_IN_ENUM = "ignoreAnyOfInEnum"; protected String dateLibrary = "threetenbp"; protected boolean supportAsync = false; @@ -87,6 +90,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code protected boolean supportJava6 = false; protected boolean disableHtmlEscaping = false; protected String booleanGetterPrefix = "get"; + protected boolean ignoreAnyOfInEnum = false; protected String parentGroupId = ""; protected String parentArtifactId = ""; protected String parentVersion = ""; @@ -184,6 +188,7 @@ public AbstractJavaCodegen() { cliOptions.add(CliOption.newBoolean(DISABLE_HTML_ESCAPING, "Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)", disableHtmlEscaping)); cliOptions.add(CliOption.newString(BOOLEAN_GETTER_PREFIX, "Set booleanGetterPrefix").defaultValue(this.getBooleanGetterPrefix())); + cliOptions.add(CliOption.newBoolean(IGNORE_ANYOF_IN_ENUM, "Ignore anyOf keyword in enum", ignoreAnyOfInEnum)); cliOptions.add(CliOption.newString(CodegenConstants.PARENT_GROUP_ID, CodegenConstants.PARENT_GROUP_ID_DESC)); cliOptions.add(CliOption.newString(CodegenConstants.PARENT_ARTIFACT_ID, CodegenConstants.PARENT_ARTIFACT_ID_DESC)); @@ -221,6 +226,11 @@ public void processOpts() { } additionalProperties.put(BOOLEAN_GETTER_PREFIX, booleanGetterPrefix); + if (additionalProperties.containsKey(IGNORE_ANYOF_IN_ENUM)) { + this.setIgnoreAnyOfInEnum(Boolean.valueOf(additionalProperties.get(IGNORE_ANYOF_IN_ENUM).toString())); + } + additionalProperties.put(IGNORE_ANYOF_IN_ENUM, ignoreAnyOfInEnum); + if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); } else if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { @@ -1062,6 +1072,28 @@ public void preprocessOpenAPI(OpenAPI openAPI) { } additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); + if (ignoreAnyOfInEnum) { + // Alter OpenAPI schemas ignore anyOf keyword if it consist of an enum. Example: + // anyOf: + // - type: string + // enum: + // - ENUM_A + // - ENUM_B + Stream.concat( + Stream.of(openAPI.getComponents().getSchemas()), + openAPI.getComponents().getSchemas().values().stream() + .filter(schema -> schema.getProperties() != null) + .map(Schema::getProperties)) + .forEach(schemas -> schemas.replaceAll( + (name, s) -> Stream.of(s) + .filter(schema -> schema instanceof ComposedSchema) + .map(schema -> (ComposedSchema) schema) + .filter(schema -> Objects.nonNull(schema.getAnyOf())) + .flatMap(schema -> schema.getAnyOf().stream()) + .filter(schema -> Objects.nonNull(schema.getEnum())) + .findFirst() + .orElse((Schema) s))); + } } private static String getAccept(OpenAPI openAPI, Operation operation) { @@ -1404,6 +1436,10 @@ public void setBooleanGetterPrefix(String booleanGetterPrefix) { this.booleanGetterPrefix = booleanGetterPrefix; } + public void setIgnoreAnyOfInEnum(boolean ignoreAnyOfInEnum) { + this.ignoreAnyOfInEnum = ignoreAnyOfInEnum; + } + @Override public String escapeQuotationMark(String input) { // remove " to avoid code injection From fa4ce9e367bc172bf24fc4b41bc8f964bb10afa5 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sat, 12 Sep 2020 11:44:39 -0400 Subject: [PATCH 2/2] [docs] Regenerate --- docs/generators/groovy.md | 1 + docs/generators/java-inflector.md | 1 + docs/generators/java-msf4j.md | 1 + docs/generators/java-pkmst.md | 1 + docs/generators/java-play-framework.md | 1 + docs/generators/java-undertow-server.md | 1 + docs/generators/java-vertx-web.md | 1 + docs/generators/java-vertx.md | 1 + docs/generators/java.md | 1 + docs/generators/jaxrs-cxf-cdi.md | 1 + docs/generators/jaxrs-cxf-client.md | 1 + docs/generators/jaxrs-cxf-extended.md | 1 + docs/generators/jaxrs-cxf.md | 1 + docs/generators/jaxrs-jersey.md | 1 + docs/generators/jaxrs-resteasy-eap.md | 1 + docs/generators/jaxrs-resteasy.md | 1 + docs/generators/jaxrs-spec.md | 1 + docs/generators/spring.md | 1 + 18 files changed, 18 insertions(+) diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 788f3936b4c7..4dd1f414a89d 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -24,6 +24,7 @@ sidebar_label: groovy |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index 17376faa76b1..7982437c1a79 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -26,6 +26,7 @@ sidebar_label: java-inflector |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.controllers| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index 7449a5bb2724..35a909dd6e52 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -26,6 +26,7 @@ sidebar_label: java-msf4j |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 32365f5c959e..ac610a825c69 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -28,6 +28,7 @@ sidebar_label: java-pkmst |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |com.prokarma| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |com.prokarma.pkmst.controller| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index e1a1f1aec544..0650ed1b8895 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -30,6 +30,7 @@ sidebar_label: java-play-framework |groupId|groupId in generated pom.xml| |org.openapitools| |handleExceptions|Add a 'throw exception' to each controller function. Add also a custom error handler where you can put your custom logic| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 876eaa288317..a9dcb53d636e 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -26,6 +26,7 @@ sidebar_label: java-undertow-server |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.handler| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 1a33c85f161d..0d3e7499362c 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -26,6 +26,7 @@ sidebar_label: java-vertx-web |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.vertxweb.server| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index af5404c8a65d..7186a6cae630 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -26,6 +26,7 @@ sidebar_label: java-vertx |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/java.md b/docs/generators/java.md index 3f7640726908..e951671ac686 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -28,6 +28,7 @@ sidebar_label: java |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.client| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index 89231211537d..ec0df1c1b45b 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -28,6 +28,7 @@ sidebar_label: jaxrs-cxf-cdi |generatePom|Whether to generate pom.xml if the file does not already exist.| |true| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index a53a9d31dfac..72167b95199c 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -26,6 +26,7 @@ sidebar_label: jaxrs-cxf-client |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 5b91b4ed43d3..534122007836 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -32,6 +32,7 @@ sidebar_label: jaxrs-cxf-extended |generateSpringBootApplication|Generate Spring Boot application| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 7a7e49c419ca..1ae25d454786 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -31,6 +31,7 @@ sidebar_label: jaxrs-cxf |generateSpringBootApplication|Generate Spring Boot application| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index b0e1006b236f..32b151ade989 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -26,6 +26,7 @@ sidebar_label: jaxrs-jersey |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 5134a3920caa..63acd11719ad 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -27,6 +27,7 @@ sidebar_label: jaxrs-resteasy-eap |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |true| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index 104a7698b9cf..8a67b7aec224 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -27,6 +27,7 @@ sidebar_label: jaxrs-resteasy |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 95b8147020c9..3eaf0fc2cfcc 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -28,6 +28,7 @@ sidebar_label: jaxrs-spec |generatePom|Whether to generate pom.xml if the file does not already exist.| |true| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index cc12471fa815..fc3ea56b7da9 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -32,6 +32,7 @@ sidebar_label: spring |groupId|groupId in generated pom.xml| |org.openapitools| |hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api|