org.javalite.activeweb.mojo.Generator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aw-mate Show documentation
Show all versions of aw-mate Show documentation
This plugin will generate Open API - compliant document from sources of an ActiveWeb app.
package org.javalite.activeweb.mojo;
import freemarker.template.TemplateException;
import org.javalite.activeweb.EndpointFinder;
import org.javalite.activeweb.Format;
import org.javalite.activeweb.OpenAPITemplateManager;
import org.javalite.common.Util;
import java.io.File;
import java.io.IOException;
public class Generator {
public String generate(String apiLocation, String templateFile, EndpointFinder endpointFinder, Format format) throws TemplateException, IOException {
String templateContent = Util.readFile(new File(apiLocation, templateFile));
String content = endpointFinder.getOpenAPIDocs(templateContent, format);
OpenAPITemplateManager m = new OpenAPITemplateManager(apiLocation);
return m.process(content);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy