diff --git a/src/main/java/com/github/kongchen/swagger/docgen/AbstractDocumentSource.java b/src/main/java/com/github/kongchen/swagger/docgen/AbstractDocumentSource.java index 0c79c2c95..1d4ebc58d 100644 --- a/src/main/java/com/github/kongchen/swagger/docgen/AbstractDocumentSource.java +++ b/src/main/java/com/github/kongchen/swagger/docgen/AbstractDocumentSource.java @@ -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) { diff --git a/src/main/java/com/github/kongchen/swagger/docgen/mavenplugin/ApiSource.java b/src/main/java/com/github/kongchen/swagger/docgen/mavenplugin/ApiSource.java index 61f04dfb0..bfb54dfe3 100644 --- a/src/main/java/com/github/kongchen/swagger/docgen/mavenplugin/ApiSource.java +++ b/src/main/java/com/github/kongchen/swagger/docgen/mavenplugin/ApiSource.java @@ -136,10 +136,10 @@ public class ApiSource { @Parameter private List modelConverters; - + @Parameter private boolean skipInheritingClasses = false; - + @Parameter private String operationIdFormat; @@ -149,16 +149,19 @@ public class ApiSource { @Parameter private List responseMessageOverrides; + @Parameter + private Map vendorExtensions = new LinkedHashMap(); + public Set> getValidClasses(Class clazz) { Set> classes = new LinkedHashSet>(); - + List prefixes = new ArrayList(); if (getLocations() == null) { prefixes.add(""); } else { prefixes.addAll(getLocations()); } - + for (String location : prefixes) { Set> c = new Reflections(location).getTypesAnnotatedWith(clazz, true); classes.addAll(c); @@ -500,5 +503,13 @@ public Boolean getRemoveBasePathFromEndpoints() { public void setRemoveBasePathFromEndpoints(Boolean removeBasePathFromEndpoints) { this.removeBasePathFromEndpoints = removeBasePathFromEndpoints; } + + public Map getVendorExtensions() { + return vendorExtensions; + } + + public void setVendorExtensions(Map vendorExtensions) { + this.vendorExtensions = vendorExtensions; + } }