Package org.sdase.commons.server.openapi
Interface OpenApiBundle.InitialBuilder
-
- All Known Subinterfaces:
OpenApiBundle.FinalBuilder
- All Known Implementing Classes:
OpenApiBundle.Builder
- Enclosing class:
- OpenApiBundle
public static interface OpenApiBundle.InitialBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description OpenApiBundle.FinalBuilderaddResourcePackage(java.lang.String resourcePackage)Adds a package to the packages Swagger should scan to pick up resources.OpenApiBundle.FinalBuilderaddResourcePackageClass(java.lang.Class<?> resourcePackageClass)Adds the package of the given class to the packages Swagger should scan to pick up resources.OpenApiBundle.FinalBuilderwithExistingOpenAPI(java.lang.String openApiJsonOrYaml)Use an existing OpenAPI 3 specification as base for the generation.default OpenApiBundle.FinalBuilderwithExistingOpenAPIFromClasspathResource(java.lang.String path)Reads an existing OpenAPI 3 specification from the given classpath resource and provide it towithExistingOpenAPI(String)
-
-
-
Method Detail
-
withExistingOpenAPI
OpenApiBundle.FinalBuilder withExistingOpenAPI(java.lang.String openApiJsonOrYaml)
Use 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
addResourcePackage(String)oraddResourcePackageClass(Class).The postprocessing will also be done for these files, including sorting, embed parameter, and server baseurl.
- Parameters:
openApiJsonOrYaml- the OpenAPI 3 specification as json or yaml- Returns:
- the builder
- See Also:
EmbedParameterModifier,SorterModifier,ServerUrlFilter
-
withExistingOpenAPIFromClasspathResource
default OpenApiBundle.FinalBuilder withExistingOpenAPIFromClasspathResource(java.lang.String path)
Reads an existing OpenAPI 3 specification from the given classpath resource and provide it towithExistingOpenAPI(String)- Parameters:
path- the path to an OpenAPI 3 YAML or JSON file in the classpath.- Returns:
- the builder
- See Also:
withExistingOpenAPI(String)
-
addResourcePackage
OpenApiBundle.FinalBuilder addResourcePackage(java.lang.String resourcePackage)
Adds a package to the packages Swagger should scan to pick up resources.- Parameters:
resourcePackage- the package to be scanned; not null- Returns:
- the builder
- Throws:
java.lang.NullPointerException- if resourcePackage is nulljava.lang.IllegalArgumentException- if resourcePackage is empty- See Also:
- Swagger's BeanConfig
-
addResourcePackageClass
OpenApiBundle.FinalBuilder addResourcePackageClass(java.lang.Class<?> resourcePackageClass)
Adds the package of the given class to the packages Swagger should scan to pick up resources.- Parameters:
resourcePackageClass- the class whose package should be scanned; not null- Returns:
- the builder
- Throws:
java.lang.NullPointerException- if resourcePackageClass is null- See Also:
- Swagger's BeanConfig
-
-