Package org.sdase.commons.server.openapi
Class OpenApiBundle.Builder
java.lang.Object
org.sdase.commons.server.openapi.OpenApiBundle.Builder
- All Implemented Interfaces:
OpenApiBundle.FinalBuilder,OpenApiBundle.InitialBuilder
- Enclosing class:
- OpenApiBundle
public static final class OpenApiBundle.Builder
extends Object
implements OpenApiBundle.InitialBuilder, OpenApiBundle.FinalBuilder
-
Method Summary
Modifier and TypeMethodDescriptionaddResourcePackage(String resourcePackage) Adds a package to the packages Swagger should scan to pick up resources.addResourcePackageClass(Class<?> resourcePackageClass) Adds the package of the given class to the packages Swagger should scan to pick up resources.build()withExistingOpenAPI(String openApiJsonOrYaml) Use an existing OpenAPI 3 specification as base for the generation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.sdase.commons.server.openapi.OpenApiBundle.InitialBuilder
withExistingOpenAPIFromClasspathResource
-
Method Details
-
addResourcePackage
Description copied from interface:OpenApiBundle.InitialBuilderAdds a package to the packages Swagger should scan to pick up resources.- Specified by:
addResourcePackagein interfaceOpenApiBundle.InitialBuilder- Parameters:
resourcePackage- the package to be scanned; not null- Returns:
- the builder
- See Also:
-
addResourcePackageClass
Description copied from interface:OpenApiBundle.InitialBuilderAdds the package of the given class to the packages Swagger should scan to pick up resources.- Specified by:
addResourcePackageClassin interfaceOpenApiBundle.InitialBuilder- Parameters:
resourcePackageClass- the class whose package should be scanned; not null- Returns:
- the builder
- See Also:
-
withExistingOpenAPI
Description copied from interface:OpenApiBundle.InitialBuilderUse an existing OpenAPI 3 specification as base for the generation.Note that the OpenAPI annotations always override values from the files if classes are registered with
OpenApiBundle.InitialBuilder.addResourcePackage(String)orOpenApiBundle.InitialBuilder.addResourcePackageClass(Class).The postprocessing will also be done for these files, including sorting, embed parameter, and server baseurl.
- Specified by:
withExistingOpenAPIin interfaceOpenApiBundle.InitialBuilder- Parameters:
openApiJsonOrYaml- the OpenAPI 3 specification as json or yaml- Returns:
- the builder
- See Also:
-
build
- Specified by:
buildin interfaceOpenApiBundle.FinalBuilder
-