io.swagger.v3.oas.integration.SwaggerConfiguration Maven / Gradle / Ivy
package io.swagger.v3.oas.integration;
import io.swagger.v3.oas.integration.api.OpenAPIConfiguration;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.media.Schema;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
public class SwaggerConfiguration implements OpenAPIConfiguration {
Map userDefinedOptions;
private OpenAPI openAPI;
private String id;
private Set resourcePackages;
private Set resourceClasses;
private String filterClass;
private String readerClass;
private String scannerClass;
private Boolean prettyPrint;
// read all operations also with no @Operation; set to false to read only methods annotated with @Operation
private Boolean readAllResources = Boolean.TRUE;
private Collection ignoredRoutes;
private Long cacheTTL = -1L;
private Set modelConverterClasses;
private String objectMapperProcessorClass;
private Boolean sortOutput;
private Boolean alwaysResolveAppPath;
private Boolean skipResolveAppPath;
private Boolean openAPI31 = false;
private Boolean convertToOpenAPI31;
private Schema.SchemaResolution schemaResolution = Schema.SchemaResolution.DEFAULT;
@Override
public String getDefaultResponseCode() {
return defaultResponseCode;
}
public void setDefaultResponseCode(String defaultResponseCode) {
this.defaultResponseCode = defaultResponseCode;
}
public SwaggerConfiguration defaultResponseCode(String defaultResponseCode) {
this.defaultResponseCode = defaultResponseCode;
return this;
}
private String defaultResponseCode;
public Long getCacheTTL() {
return cacheTTL;
}
public void setCacheTTL(Long cacheTTL) {
this.cacheTTL = cacheTTL;
}
public SwaggerConfiguration cacheTTL(Long cacheTTL) {
this.cacheTTL = cacheTTL;
return this;
}
public Boolean isReadAllResources() {
return readAllResources;
}
public void setReadAllResources(Boolean readAllResources) {
this.readAllResources = readAllResources;
}
public SwaggerConfiguration readAllResources(Boolean readAllResources) {
this.readAllResources = readAllResources;
return this;
}
public Collection getIgnoredRoutes() {
return ignoredRoutes;
}
public void setIgnoredRoutes(Collection ignoredRoutes) {
this.ignoredRoutes = ignoredRoutes;
}
public SwaggerConfiguration ignoredRoutes(Collection ignoredRoutes) {
this.ignoredRoutes = ignoredRoutes;
return this;
}
public Boolean isPrettyPrint() {
return prettyPrint;
}
public void setPrettyPrint(Boolean prettyPrint) {
this.prettyPrint = prettyPrint;
}
public SwaggerConfiguration prettyPrint(Boolean prettyPrint) {
this.prettyPrint = prettyPrint;
return this;
}
@Override
public OpenAPI getOpenAPI() {
return openAPI;
}
public void setOpenAPI(OpenAPI openAPI) {
this.openAPI = openAPI;
}
public SwaggerConfiguration openAPI(OpenAPI openAPI) {
this.openAPI = openAPI;
return this;
}
public String getReaderClass() {
return readerClass;
}
public void setReaderClass(String readerClass) {
this.readerClass = readerClass;
}
public String getScannerClass() {
return scannerClass;
}
public void setScannerClass(String scannerClass) {
this.scannerClass = scannerClass;
}
public Map getUserDefinedOptions() {
return userDefinedOptions;
}
public void setUserDefinedOptions(Map userDefinedOptions) {
this.userDefinedOptions = userDefinedOptions;
}
public SwaggerConfiguration scannerClass(String scannerClass) {
this.scannerClass = scannerClass;
return this;
}
public SwaggerConfiguration readerClass(String readerClass) {
this.readerClass = readerClass;
return this;
}
public SwaggerConfiguration userDefinedOptions(Map userDefinedOptions) {
this.userDefinedOptions = userDefinedOptions;
return this;
}
@Override
public Set getResourcePackages() {
return resourcePackages;
}
public void setResourcePackages(Set resourcePackages) {
this.resourcePackages = resourcePackages;
}
public SwaggerConfiguration resourcePackages(Set resourcePackages) {
this.resourcePackages = resourcePackages;
return this;
}
public Set getResourceClasses() {
return resourceClasses;
}
public void setResourceClasses(Set resourceClasses) {
this.resourceClasses = resourceClasses;
}
public SwaggerConfiguration resourceClasses(Set resourceClasses) {
this.resourceClasses = resourceClasses;
return this;
}
public String getFilterClass() {
return filterClass;
}
public void setFilterClass(String filterClass) {
this.filterClass = filterClass;
}
public SwaggerConfiguration filterClass(String filterClass) {
this.filterClass = filterClass;
return this;
}
public SwaggerConfiguration id(String id) {
this.id = id;
return this;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
/**
* @since 2.0.6
*/
public SwaggerConfiguration objectMapperProcessorClass(String objectMapperProcessorClass) {
this.objectMapperProcessorClass = objectMapperProcessorClass;
return this;
}
/**
* @since 2.0.6
*/
public String getObjectMapperProcessorClass() {
return objectMapperProcessorClass;
}
/**
* @since 2.0.6
*/
public void setObjectMapperProcessorClass(String objectMapperProcessorClass) {
this.objectMapperProcessorClass = objectMapperProcessorClass;
}
/**
* @since 2.0.6
*/
public Set getModelConverterClasses() {
return modelConverterClasses;
}
/**
* @since 2.0.6
*/
public void setModelConverterClassess(Set modelConverterClasses) {
this.modelConverterClasses = modelConverterClasses;
}
/**
* @since 2.0.6
*/
public SwaggerConfiguration modelConverterClasses(Set modelConverterClasses) {
this.modelConverterClasses = modelConverterClasses;
return this;
}
/**
* @since 2.1.6
*/
@Override
public Boolean isSortOutput() {
return sortOutput;
}
/**
* @since 2.1.6
*/
public void setSortOutput(Boolean sortOutput) {
this.sortOutput = sortOutput;
}
/**
* @since 2.1.6
*/
public SwaggerConfiguration sortOutput(Boolean sortOutput) {
setSortOutput(sortOutput);
return this;
}
/**
* @since 2.1.9
*/
@Override
public Boolean isAlwaysResolveAppPath() {
return alwaysResolveAppPath;
}
/**
* @since 2.1.9
*/
public void setAlwaysResolveAppPath(Boolean alwaysResolveAppPath) {
this.alwaysResolveAppPath = alwaysResolveAppPath;
}
/**
* @since 2.1.9
*/
public SwaggerConfiguration alwaysResolveAppPath(Boolean alwaysResolveAppPath) {
setAlwaysResolveAppPath(alwaysResolveAppPath);
return this;
}
/**
* @since 2.1.15
*/
@Override
public Boolean isSkipResolveAppPath() {
return skipResolveAppPath;
}
/**
* @since 2.1.15
*/
public void setSkipResolveAppPath(Boolean skipResolveAppPath) {
this.skipResolveAppPath = skipResolveAppPath;
}
/**
* @since 2.1.15
*/
public SwaggerConfiguration skipResolveAppPath(Boolean skipResolveAppPath) {
setSkipResolveAppPath(skipResolveAppPath);
return this;
}
/**
* @since 2.1.9
*/
public Boolean isOpenAPI31() {
return openAPI31;
}
/**
* @since 2.1.9
*/
public void setOpenAPI31(Boolean openAPI31) {
this.openAPI31 = openAPI31;
}
/**
* @since 2.1.9
*/
public SwaggerConfiguration openAPI31(Boolean openAPI31) {
this.openAPI31 = openAPI31;
return this;
}
/**
* @since 2.2.12
*/
public Boolean isConvertToOpenAPI31() {
return convertToOpenAPI31;
}
/**
* @since 2.2.12
*/
public void setConvertToOpenAPI31(Boolean convertToOpenAPI31) {
this.convertToOpenAPI31 = convertToOpenAPI31;
if (Boolean.TRUE.equals(convertToOpenAPI31)) {
this.openAPI31 = true;
}
}
/**
* @since 2.2.12
*/
public SwaggerConfiguration convertToOpenAPI31(Boolean convertToOpenAPI31) {
this.setConvertToOpenAPI31(convertToOpenAPI31);
return this;
}
@Override
public Schema.SchemaResolution getSchemaResolution() {
return schemaResolution;
}
public void setSchemaResolution(Schema.SchemaResolution schemaResolution) {
this.schemaResolution = schemaResolution;
}
public SwaggerConfiguration schemaResolution(Schema.SchemaResolution schemaResolution) {
this.setSchemaResolution(schemaResolution);
return this;
}
}