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
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.withExistingOpenAPI(String openApiJsonOrYaml) Use an existing OpenAPI 3 specification as base for the generation.default OpenApiBundle.FinalBuilderReads an existing OpenAPI 3 specification from the given classpath resource and provide it towithExistingOpenAPI(String)
-
Method Details
-
withExistingOpenAPI
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:
-
withExistingOpenAPIFromClasspathResource
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:
-
addResourcePackage
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:
NullPointerException- if resourcePackage is nullIllegalArgumentException- if resourcePackage is empty- See Also:
-
addResourcePackageClass
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:
NullPointerException- if resourcePackageClass is null- See Also:
-