Class OpenAPITask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
io.jooby.gradle.BaseTask
io.jooby.gradle.OpenAPITask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

public class OpenAPITask extends BaseTask
Generate an OpenAPI file from a jooby application. Usage: https://jooby.io/modules/openapi
Since:
2.7.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields inherited from class io.jooby.gradle.BaseTask

    APP_CLASS_NAME

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an OpenAPI task.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Generate OpenAPI files from Jooby application.
    Optionally generates adoc output.
    @Nullable String
    Regular expression used to excludes route.
    @Nullable String
    Regular expression used to includes/keep route.
    True/On to enabled javadoc output.
    Class to parse.
    Deprecated.
    Get the OpenAPI spec version.
    void
    setAdoc(List<File> adoc)
    Set adoc templates to build.
    void
    setExcludes(@Nullable String excludes)
    Set Regular expression used to excludes route.
    void
    setIncludes(@Nullable String includes)
    Set regular expression used to includes/keep route.
    void
    setJavadoc(String javadoc)
    Enabled or disabled javadoc generation.
    void
    setMainClass(String mainClassName)
    Set Class to parse.
    void
    setMainClassName(String mainClassName)
    Deprecated.
    void
    setSpecVersion(String specVersion)
    Set the spec version to use.

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Constructor Details

    • OpenAPITask

      public OpenAPITask()
      Creates an OpenAPI task.
  • Method Details

    • generate

      public void generate() throws Throwable
      Generate OpenAPI files from Jooby application.
      Throws:
      Throwable - If something goes wrong.
    • getMainClass

      @Input @Optional public String getMainClass()
      Class to parse.
      Returns:
      Class to parse.
    • setMainClass

      public void setMainClass(String mainClassName)
      Set Class to parse.
      Parameters:
      mainClassName - Class to parse.
    • getMainClassName

      @Deprecated @ReplacedBy("mainClass") public String getMainClassName()
      Deprecated.
      Class to parse.
      Returns:
      Class to parse.
    • setMainClassName

      @Deprecated public void setMainClassName(String mainClassName)
      Deprecated.
      Set Class to parse.
      Parameters:
      mainClassName - Class to parse.
    • getIncludes

      @Input @Optional public @Nullable String getIncludes()
      Regular expression used to includes/keep route. Example: /api/.*.
      Returns:
      Regular expression used to includes/keep route. Example: /api/.*.
    • setIncludes

      public void setIncludes(@Nullable String includes)
      Set regular expression used to includes/keep route. Example: /api/.*.
      Parameters:
      includes - Regular expression.
    • getExcludes

      @Input @Optional public @Nullable String getExcludes()
      Regular expression used to excludes route. Example: /web.
      Returns:
      Regular expression used to excludes route. Example: /web.
    • setExcludes

      public void setExcludes(@Nullable String excludes)
      Set Regular expression used to excludes route. Example: /web.
      Parameters:
      excludes - Regular expression used to excludes route. Example: /web.
    • getSpecVersion

      @Input @Optional public String getSpecVersion()
      Get the OpenAPI spec version. One of 3.0.1, 3.1.0.
      Returns:
      The OpenAPI spec version. One of 3.0.1, 3.1.0.
    • setSpecVersion

      public void setSpecVersion(String specVersion)
      Set the spec version to use.
      Parameters:
      specVersion - Spec version. One of 3.0.1, 3.1.0.
    • getJavadoc

      @Input @Optional public String getJavadoc()
      True/On to enabled javadoc output. Default is: on.
      Returns:
      True/On to enabled javadoc output. Default is: on.
    • setJavadoc

      public void setJavadoc(String javadoc)
      Enabled or disabled javadoc generation. Set to off/false to turn it off. Default is: on.
      Parameters:
      javadoc - Enabled or disabled javadoc generation. Set to off/false to turn it off. Default is: on.
    • getAdoc

      @Input @Optional public List<File> getAdoc()
      Optionally generates adoc output.
      Returns:
      List of adoc templates.
    • setAdoc

      public void setAdoc(List<File> adoc)
      Set adoc templates to build.
      Parameters:
      adoc - Adoc templates to build.