mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
don't expose documentation class in the method signature as it's not available at runtime
This commit is contained in:
1
pom.xml
1
pom.xml
@@ -66,7 +66,6 @@
|
|||||||
</includes>
|
</includes>
|
||||||
</resource>
|
</resource>
|
||||||
</webResources>
|
</webResources>
|
||||||
<packagingExcludes>**/APIGenerator.class</packagingExcludes>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class APIGenerator extends AbstractProcessor {
|
|||||||
|
|
||||||
apiDoc.setSwaggerVersion(swaggerVersion);
|
apiDoc.setSwaggerVersion(swaggerVersion);
|
||||||
apiDoc.setApiVersion(apiVersion);
|
apiDoc.setApiVersion(apiVersion);
|
||||||
write(apiDoc, element);
|
write(apiDoc.getResourcePath(), apiDoc, element);
|
||||||
|
|
||||||
doc.addApi(new DocumentationEndPoint(api.value(), api.description()));
|
doc.addApi(new DocumentationEndPoint(api.value(), api.description()));
|
||||||
|
|
||||||
@@ -73,13 +73,13 @@ public class APIGenerator extends AbstractProcessor {
|
|||||||
doc.setSwaggerVersion(swaggerVersion);
|
doc.setSwaggerVersion(swaggerVersion);
|
||||||
doc.setApiVersion(apiVersion);
|
doc.setApiVersion(apiVersion);
|
||||||
|
|
||||||
write(doc, null);
|
write(doc.getResourcePath(), doc, null);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void write(Documentation doc, Element element) throws Exception {
|
private void write(String resourcePath, Object doc, Element element) throws Exception {
|
||||||
String fileName = doc.getResourcePath() == null ? "resources" : doc.getResourcePath();
|
String fileName = StringUtils.defaultString(resourcePath, "resources");
|
||||||
fileName = StringUtils.removeStart(fileName, "/");
|
fileName = StringUtils.removeStart(fileName, "/");
|
||||||
|
|
||||||
FileObject resource = null;
|
FileObject resource = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user