[REQ] Add mapping for openapi.html in OpenApiServlet
Created by: TheAndrewSAMA
The interface Generator which every Generator has to implement (like the DefaultGenerator) contains one generate() method that returns List<File>
I think it would be great to be able to generate a String or a List<String>, at least as far as documentation is concerned (e.g. HTML docs). That way one could make a servlet that returns the html static docs without saving them to the filesystem.
I've tried directly accessing the public String compileTemplate(TemplatingExecutor executor, Map<String, Object> bundle, String templateFile) in the MustacheEngineAdapter, but it is not possibile unless you generate the bundle using methods that are package scoped inside the DefaultGenerator.
An alternative solution would be to make the OpenApiServlet recognize the type "html" (in addition to the current json and yaml) and return the html generated docs to the caller, eliminating the need to implement a custom servlet.
Generator
public interface Generator {
Generator opts(ClientOptInput var1);
List<File> generate();
}
MustacheEngineAdapter
public String compileTemplate(TemplatingExecutor executor, Map<String, Object> bundle, String templateFile) throws IOException {...}
DefaultGenerator
Map<String, Object> buildSupportFileBundle(List<OperationsMap> allOperations, List<ModelMap> allModels) {...}