Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added vendorExtensions to document root #818

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public AbstractDocumentSource(Log log, ApiSource apiSource, String encoding) thr
swagger.setInfo(apiSource.getInfo());
swagger.setBasePath(apiSource.getBasePath());
swagger.setExternalDocs(apiSource.getExternalDocs());
swagger.setVendorExtensions(apiSource.getVendorExtensions());

this.apiSource = apiSource;
if (encoding != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ public class ApiSource {

@Parameter
private List<String> modelConverters;

@Parameter
private boolean skipInheritingClasses = false;

@Parameter
private String operationIdFormat;

Expand All @@ -149,16 +149,19 @@ public class ApiSource {
@Parameter
private List<ResponseMessageOverride> responseMessageOverrides;

@Parameter
private Map<String, Object> vendorExtensions = new LinkedHashMap();

public Set<Class<?>> getValidClasses(Class<? extends Annotation> clazz) {
Set<Class<?>> classes = new LinkedHashSet<Class<?>>();

List<String> prefixes = new ArrayList<String>();
if (getLocations() == null) {
prefixes.add("");
} else {
prefixes.addAll(getLocations());
}

for (String location : prefixes) {
Set<Class<?>> c = new Reflections(location).getTypesAnnotatedWith(clazz, true);
classes.addAll(c);
Expand Down Expand Up @@ -500,5 +503,13 @@ public Boolean getRemoveBasePathFromEndpoints() {
public void setRemoveBasePathFromEndpoints(Boolean removeBasePathFromEndpoints) {
this.removeBasePathFromEndpoints = removeBasePathFromEndpoints;
}

public Map<String, Object> getVendorExtensions() {
return vendorExtensions;
}

public void setVendorExtensions(Map<String, Object> vendorExtensions) {
this.vendorExtensions = vendorExtensions;
}
}