Class OpenAPIAction<A extends OpenAPIAction>

  • All Implemented Interfaces:
    java.lang.Comparable<A>

    public class OpenAPIAction<A extends OpenAPIAction>
    extends io.inversion.action.misc.FileAction<A>
    https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Getting-started https://javadoc.io/doc/io.swagger.core.v3/swagger-models/latest/index.html https://mvnrepository.com/artifact/io.swagger.core.v3 https://mvnrepository.com/artifact/io.swagger.core.v3/swagger-core https://swagger.io/tools/open-source/open-source-integrations/ https://github.com/swagger-api/swagger-core https://swagger.io/specification/
    • Nested Class Summary

      • Nested classes/interfaces inherited from class io.inversion.Rule

        io.inversion.Rule.RuleMatcher
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean copyToOutputDirInDevMode  
      protected java.lang.String outputBaseDir  
      protected java.lang.String patchesBaseDir  
      protected java.lang.String templateBaseDir  
      protected OpenAPISpecWriter writer  
      • Fields inherited from class io.inversion.action.misc.FileAction

        baseDir, files
      • Fields inherited from class io.inversion.Rule

        ALL_METHODS, configMap, description, excludeMatchers, excludeOn, includeMatchers, includeOn, log, name, order, params
    • Constructor Summary

      Constructors 
      Constructor Description
      OpenAPIAction()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doGet​(io.inversion.Request req, io.inversion.Response res)  
      java.lang.String findTemplate​(io.inversion.Request req)  
      io.swagger.v3.oas.models.OpenAPI generateOpenApi​(io.inversion.Request req)  
      java.lang.String getOutputBaseDir()  
      java.lang.String getPatchesBaseDir()  
      java.lang.String getTemplateBaseDir()  
      OpenAPISpecWriter getWriter()  
      void serveOpenApi​(io.inversion.Request req, io.inversion.Response res, java.lang.String file)  
      OpenAPIAction withOutputBaseDir​(java.lang.String outputBaseDir)  
      OpenAPIAction withPatchesBaseDir​(java.lang.String patchesBaseDir)  
      OpenAPIAction withTemplateBaseDir​(java.lang.String templateBaseDir)  
      OpenAPIAction withWriter​(OpenAPISpecWriter writer)  
      io.inversion.json.JSNode writeOpenAPI​(io.inversion.Request req, io.swagger.v3.oas.models.OpenAPI openApi)
      Override me to manually edit the OpenAPI pojo before it is serialized to JSON OR to edit the JSNode model after it has been serialized.
      • Methods inherited from class io.inversion.action.misc.FileAction

        canServe, findStream, getBaseDir, getFiles, serveFile, serveFile, withBaseDir, withFiles
      • Methods inherited from class io.inversion.Action

        configureOp, doDelete, doPatch, doPost, doPut, getFullIncludePaths, getIncludePaths, isDecoration, joinPaths, joinPaths0, run, run0, withDecoration
      • Methods inherited from class io.inversion.Rule

        afterWiringComplete, checkLazyConfig, compareTo, doLazyConfig, getAllExcludePaths, getAllIncludeMethods, getAllIncludePaths, getDefaultIncludeMatchers, getDescription, getExcludeMatchers, getIncludeMatchers, getName, getOrder, getParams, match, match, matches, matches, toString, withDescription, withExcludeOn, withExcludeOn, withIncludeOn, withIncludeOn, withName, withOrder, withParam, withParams
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • templateBaseDir

        protected java.lang.String templateBaseDir
      • patchesBaseDir

        protected java.lang.String patchesBaseDir
      • outputBaseDir

        protected java.lang.String outputBaseDir
      • copyToOutputDirInDevMode

        protected boolean copyToOutputDirInDevMode
    • Constructor Detail

      • OpenAPIAction

        public OpenAPIAction()
    • Method Detail

      • doGet

        public void doGet​(io.inversion.Request req,
                          io.inversion.Response res)
                   throws io.inversion.ApiException
        Overrides:
        doGet in class io.inversion.action.misc.FileAction<A extends OpenAPIAction>
        Throws:
        io.inversion.ApiException
      • serveOpenApi

        public void serveOpenApi​(io.inversion.Request req,
                                 io.inversion.Response res,
                                 java.lang.String file)
      • writeOpenAPI

        public io.inversion.json.JSNode writeOpenAPI​(io.inversion.Request req,
                                                     io.swagger.v3.oas.models.OpenAPI openApi)
        Override me to manually edit the OpenAPI pojo before it is serialized to JSON OR to edit the JSNode model after it has been serialized.
        Parameters:
        openApi -
        Returns:
        the JSNode representation of the OpenAPI JSON.
      • generateOpenApi

        public io.swagger.v3.oas.models.OpenAPI generateOpenApi​(io.inversion.Request req)
      • findTemplate

        public java.lang.String findTemplate​(io.inversion.Request req)
      • getTemplateBaseDir

        public java.lang.String getTemplateBaseDir()
      • withTemplateBaseDir

        public OpenAPIAction withTemplateBaseDir​(java.lang.String templateBaseDir)
      • getPatchesBaseDir

        public java.lang.String getPatchesBaseDir()
      • withPatchesBaseDir

        public OpenAPIAction withPatchesBaseDir​(java.lang.String patchesBaseDir)
      • getOutputBaseDir

        public java.lang.String getOutputBaseDir()
      • withOutputBaseDir

        public OpenAPIAction withOutputBaseDir​(java.lang.String outputBaseDir)