All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.javalite.activeweb.mojo.Generator Maven / Gradle / Ivy

Go to download

This plugin will generate Open API - compliant document from sources of an ActiveWeb app.

There is a newer version: 3.3
Show newest version
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