Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion bin/configs/spring-boot-beanvalidation-no-nullable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
documentationProvider: springfox
#documentationProvider: springdoc
java8: "false"
useBeanValidation: true
artifactId: spring-boot-beanvalidation-no-nullable
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/spring-boot-beanvalidation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
#documentationProvider: springdoc
useSwaggerUI: false
java8: true
useBeanValidation: true
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/spring-boot-builtin-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
#documentationProvider: springdoc
useSwaggerUI: false
java8: true
useBeanValidation: true
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/spring-boot-delegate-j8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ outputDir: samples/server/petstore/springboot-delegate-j8
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
#documentationProvider: springdoc
artifactId: springboot-delegate-j8
hideGenerationTimestamp: "true"
delegatePattern: "true"
2 changes: 1 addition & 1 deletion bin/configs/spring-boot-delegate-no-response-entity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ outputDir: samples/server/petstore/springboot-delegate-no-response-entity
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
#documentationProvider: springdoc
artifactId: springboot-delegate-no-response-entity
hideGenerationTimestamp: "true"
java8: true
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/spring-boot-delegate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ outputDir: samples/server/petstore/springboot-delegate
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
documentationProvider: springdoc
artifactId: springboot-delegate
hideGenerationTimestamp: "true"
java8: true
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/spring-boot-implicitHeaders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
artifactId: springboot-implicitHeaders
documentationProvider: springfox
documentationProvider: springdoc
hideGenerationTimestamp: "true"
implicitHeadersRegex: .*
2 changes: 1 addition & 1 deletion bin/configs/spring-boot-include-http-request-context.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ outputDir: samples/server/petstore/springboot-include-http-request-context
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
documentationProvider: springdoc
artifactId: springboot
snapshotVersion: "true"
hideGenerationTimestamp: "true"
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/spring-boot-reactive-noResponseEntity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: springboot-reactive-noResponseEntity
documentationProvider: springfox
documentationProvider: springdoc
reactive: "true"
hideGenerationTimestamp: "true"
delegatePattern: "true"
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/spring-boot-reactive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: springboot-reactive
documentationProvider: springfox
documentationProvider: springdoc
reactive: "true"
hideGenerationTimestamp: "true"
delegatePattern: "true"
2 changes: 1 addition & 1 deletion bin/configs/spring-boot-useoptional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
documentationProvider: springfox
#documentationProvider: springdoc
useOptional: true
artifactId: spring-boot-useoptional
hideGenerationTimestamp: "true"
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/spring-boot-x-implements-skip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
additionalNotNullAnnotations: true
documentationProvider: springfox
documentationProvider: springdoc
artifactId: springboot
snapshotVersion: "true"
hideGenerationTimestamp: "true"
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/spring-boot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ outputDir: samples/server/petstore/springboot
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
documentationProvider: springdoc
artifactId: springboot
snapshotVersion: "true"
hideGenerationTimestamp: "true"
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/spring-cloud-date-time.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ outputDir: samples/client/petstore/spring-cloud-date-time
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
documentationProvider: springdoc
artifactId: spring-cloud-date-time
interfaceOnly: "true"
singleContentTypes: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ library: spring-cloud
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
documentationProvider: springdoc
artifactId: petstore-spring-cloud
hideGenerationTimestamp: "true"
useFeignClientUrl: "false"
4 changes: 2 additions & 2 deletions bin/configs/spring-cloud-tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ outputDir: samples/client/petstore/spring-cloud-tags
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-tags.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
#documentationProvider: springdoc
artifactId: spring-cloud-date-time
interfaceOnly: "true"
singleContentTypes: "true"
hideGenerationTimestamp: "true"
useTags: "false"
apiNameSuffix: "Controller"
apiNameSuffix: "Controller"
2 changes: 1 addition & 1 deletion bin/configs/spring-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ library: spring-cloud
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
#documentationProvider: springdoc
artifactId: petstore-spring-cloud
hideGenerationTimestamp: "true"
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ additionalProperties:
hideGenerationTimestamp: "true"
reactive: "true"
# documentation provider should be ignored
documentationProvider: "springfox"
documentationProvider: "springdoc"
# annotation provider should be ignored
annotationLibrary: "swagger1"
# validation should be ignored
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/spring-http-interface-reactive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ additionalProperties:
hideGenerationTimestamp: "true"
reactive: "true"
# documentation provider should be ignored
documentationProvider: "springfox"
documentationProvider: "springdoc"
# annotation provider should be ignored
annotationLibrary: "swagger1"
# validation should be ignored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ templateDir: modules/openapi-generator/src/main/resources/JavaSpring
delegatePattern: true
java8: false
additionalProperties:
documentationProvider: springfox
documentationProvider: springdoc
artifactId: springboot-spring-pageable-delegatePattern-without-j8
hideGenerationTimestamp: 'true'
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
delegatePattern: true
additionalProperties:
documentationProvider: springfox
documentationProvider: springdoc
artifactId: springboot-spring-pageable-delegatePattern
hideGenerationTimestamp: 'true'
implicitHeadersRegex: ^Version.*
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
java8: false
additionalProperties:
documentationProvider: springfox
documentationProvider: springdoc
artifactId: springboot-spring-pageable-withoutj8
hideGenerationTimestamp: 'true'
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
documentationProvider: springdoc
artifactId: springboot-spring-pageable
hideGenerationTimestamp: 'true'
implicitHeadersRegex: ^Version.*
2 changes: 1 addition & 1 deletion docs/generators/java-camel.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**source**</dt><dd>Publish the original input OpenAPI specification.</dd><dt>**springfox**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.</dd><dt>**springdoc**</dt><dd>Generate an OpenAPI 3 specification using SpringDoc.</dd></dl>|springdoc|
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**source**</dt><dd>Publish the original input OpenAPI specification.</dd><dt>**springdoc**</dt><dd>Generate an OpenAPI 3 specification using SpringDoc.</dd></dl>|springdoc|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
Expand Down
2 changes: 1 addition & 1 deletion docs/generators/spring.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**source**</dt><dd>Publish the original input OpenAPI specification.</dd><dt>**springfox**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.</dd><dt>**springdoc**</dt><dd>Generate an OpenAPI 3 specification using SpringDoc.</dd></dl>|springdoc|
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**source**</dt><dd>Publish the original input OpenAPI specification.</dd><dt>**springdoc**</dt><dd>Generate an OpenAPI 3 specification using SpringDoc.</dd></dl>|springdoc|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ public List<DocumentationProvider> supportedDocumentationProvider() {
List<DocumentationProvider> supportedProviders = new ArrayList<>();
supportedProviders.add(DocumentationProvider.NONE);
supportedProviders.add(DocumentationProvider.SOURCE);
supportedProviders.add(DocumentationProvider.SPRINGFOX);
supportedProviders.add(DocumentationProvider.SPRINGDOC);
return supportedProviders;
}
Expand All @@ -386,7 +385,7 @@ public List<AnnotationLibrary> supportedAnnotationLibraries() {
* @return true if the selected DocumentationProvider requires us to bootstrap swagger-ui.
*/
private boolean selectedDocumentationProviderRequiresSwaggerUiBootstrap() {
return getDocumentationProvider().equals(DocumentationProvider.SPRINGFOX) || getDocumentationProvider().equals(DocumentationProvider.SOURCE);
return getDocumentationProvider().equals(DocumentationProvider.SOURCE);
}

@Override
Expand Down Expand Up @@ -447,10 +446,6 @@ public void processOpts() {
+ "useJakartaEe defaulted to 'true'");
}

if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) {
LOGGER.warn("The springfox documentation provider is deprecated for removal. Use the springdoc provider instead.");
}

// clear model and api doc template as this codegen
// does not support auto-generated markdown doc at the moment
// TODO: add doc templates
Expand Down Expand Up @@ -529,9 +524,6 @@ public void processOpts() {
throw new IllegalArgumentException("Choose between Spring Boot 3 and Spring Boot 4");
}
if (isUseSpringBoot3() || isUseSpringBoot4()) {
if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) {
throw new IllegalArgumentException(DocumentationProvider.SPRINGFOX.getPropertyName() + " is not supported with Spring Boot > 3.x");
}
if (AnnotationLibrary.SWAGGER1.equals(getAnnotationLibrary())) {
throw new IllegalArgumentException(AnnotationLibrary.SWAGGER1.getPropertyName() + " is not supported with Spring Boot > 3.x");
}
Expand Down Expand Up @@ -562,7 +554,6 @@ public void processOpts() {
importMapping.put("Nullable", "org.springframework.lang.Nullable");
importMapping.put("org.springframework.core.io.Resource", "org.springframework.core.io.Resource");
importMapping.put("DateTimeFormat", "org.springframework.format.annotation.DateTimeFormat");
importMapping.put("ApiIgnore", "springfox.documentation.annotations.ApiIgnore");
importMapping.put("ParameterObject", "org.springdoc.api.annotations.ParameterObject");
if (isUseSpringBoot3() || isUseSpringBoot4()) {
importMapping.put("ParameterObject", "org.springdoc.core.annotations.ParameterObject");
Expand Down Expand Up @@ -637,10 +628,6 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("springdocDocumentationConfig.mustache",
(sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
"SpringDocConfiguration.java"));
} else if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) {
supportingFiles.add(new SupportingFile("openapiDocumentationConfig.mustache",
(sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
"SpringFoxConfiguration.java"));
}
}
} else if (SPRING_HTTP_INTERFACE.equals(library)) {
Expand Down Expand Up @@ -1140,9 +1127,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation
// add org.springframework.data.domain.Pageable import when needed
if (codegenOperation.vendorExtensions.containsKey("x-spring-paginated")) {
codegenOperation.imports.add("Pageable");
if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) {
codegenOperation.imports.add("ApiIgnore");
}
if (DocumentationProvider.SPRINGDOC.equals(getDocumentationProvider())) {
codegenOperation.imports.add("ParameterObject");
}
Expand All @@ -1162,9 +1146,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation

addSpringNullableImportForOperation(codegenOperation);

if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider()) && includeHttpRequestContext != null && includeHttpRequestContext) {
codegenOperation.imports.add("ApiIgnore");
}
if (reactive && sse) {
var MEDIA_EVENT_STREAM = "text/event-stream";
// inspecting used streaming media types
Expand Down
Loading
Loading