Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #14705
Closed
Open
Issue created Feb 15, 2023 by Administrator@rootContributor

[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) {...}
Assignee
Assign to
Time tracking