Package io.jooby.gradle
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>
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_NAMEFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerate()Generate OpenAPI files from Jooby application.getAdoc()Optionally generates adoc output.@Nullable StringRegular expression used to excludes route.@Nullable StringRegular expression used to includes/keep route.True/On to enabled javadoc output.Class to parse.Deprecated.Get the OpenAPI spec version.voidSet adoc templates to build.voidsetExcludes(@Nullable String excludes) Set Regular expression used to excludes route.voidsetIncludes(@Nullable String includes) Set regular expression used to includes/keep route.voidsetJavadoc(String javadoc) Enabled or disabled javadoc generation.voidsetMainClass(String mainClassName) Set Class to parse.voidsetMainClassName(String mainClassName) Deprecated.voidsetSpecVersion(String specVersion) Set the spec version to use.Methods inherited from class io.jooby.gradle.BaseTask
binDirectories, classes, classpath, computeMainClassName, createClassLoader, getJavaExtension, getProjects, jars, sourceDirectories, sourceSetMethods 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, usesServiceMethods 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, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, notCompatibleWithConfigurationCache
-
Constructor Details
-
OpenAPITask
public OpenAPITask()Creates an OpenAPI task.
-
-
Method Details
-
generate
Generate OpenAPI files from Jooby application.- Throws:
Throwable- If something goes wrong.
-
getMainClass
Class to parse.- Returns:
- Class to parse.
-
setMainClass
Set Class to parse.- Parameters:
mainClassName- Class to parse.
-
getMainClassName
Deprecated.Class to parse.- Returns:
- Class to parse.
-
setMainClassName
Deprecated.Set Class to parse.- Parameters:
mainClassName- Class to parse.
-
getIncludes
Regular expression used to includes/keep route. Example:/api/.*.- Returns:
- Regular expression used to includes/keep route. Example:
/api/.*.
-
setIncludes
Set regular expression used to includes/keep route. Example:/api/.*.- Parameters:
includes- Regular expression.
-
getExcludes
Regular expression used to excludes route. Example:/web.- Returns:
- Regular expression used to excludes route. Example:
/web.
-
setExcludes
Set Regular expression used to excludes route. Example:/web.- Parameters:
excludes- Regular expression used to excludes route. Example:/web.
-
getSpecVersion
Get the OpenAPI spec version. One of3.0.1,3.1.0.- Returns:
- The OpenAPI spec version. One of
3.0.1,3.1.0.
-
setSpecVersion
Set the spec version to use.- Parameters:
specVersion- Spec version. One of3.0.1,3.1.0.
-
getJavadoc
True/On to enabled javadoc output. Default is:on.- Returns:
- True/On to enabled javadoc output. Default is:
on.
-
setJavadoc
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
Optionally generates adoc output.- Returns:
- List of adoc templates.
-
setAdoc
Set adoc templates to build.- Parameters:
adoc- Adoc templates to build.
-