@CompileStatic class ActionAnnotations extends java.lang.Object
Reads the OpenAPI annotations an application declares on a controller and its actions, so that what is derived from the URL mappings can be corrected or enriched.
The annotations are converted by swagger-core itself, so they mean what they mean on a Spring or JAX-RS endpoint: a schema, an array schema, a media type, an example or a header is described exactly as declared, and a type an annotation names is added to the components.
| Type | Name and description |
|---|---|
static java.lang.String |
DEFAULT_MEDIA_TYPE |
| Constructor and description |
|---|
ActionAnnotations() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static java.lang.reflect.Method |
actionMethod(java.lang.Class<?> controllerClass, java.lang.String actionName)The method an action is declared as. |
|
static void |
apply(io.swagger.v3.oas.annotations.Operation operation, java.lang.Class<?> controllerClass, java.lang.String actionName, io.swagger.v3.oas.models.Components components, boolean openapi31)Applies the declared annotations over the operation derived for the action. |
|
static java.lang.Class<?> |
commandObjectType(java.lang.Class<?> controllerClass, java.lang.String actionName)The command object an action binds, if it takes one. |
|
static java.util.List<TagAnnotation> |
declaredTags(java.lang.Class<?> controllerClass)The tags a controller declares, which group its operations and can describe the group. |
|
static boolean |
declaresRequestBody(java.lang.Class<?> controllerClass, java.lang.String actionName)
|
|
static boolean |
isAnnotated(java.lang.Class<?> controllerClass, java.lang.String actionName)
|
|
static boolean |
isHidden(java.lang.Class<?> controllerClass)
|
|
static boolean |
isHidden(java.lang.Class<?> controllerClass, java.lang.String actionName)
|
|
static java.lang.String |
requestParameterName(java.lang.reflect.Parameter parameter)The name of the request parameter an action parameter is bound from: the one @RequestParameter names, or its own. |
|
static java.util.List<java.lang.reflect.Parameter> |
requestParameters(java.lang.Class<?> controllerClass, java.lang.String actionName)The request parameters an action binds by name: the parameters of a simple type. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
The method an action is declared as. Grails compiles an action that takes parameters into a second method without them, which binds the parameters and calls the declared one, so the declared one is the one that takes them.
null where the controller has no method of that nameApplies the declared annotations over the operation derived for the action. The controller's annotations apply first, so an action can refine what its controller declares, and a value that is not declared is left as derived.
The command object an action binds, if it takes one.
Follows the rule the controller transform applies: a parameter of a simple type is bound
from the request parameters, an Object, an interface or an abstract class is not bound
at all, and any other type is bound as a command object.
null when the action takes noneThe tags a controller declares, which group its operations and can describe the group.
@Operation or its controller declares
@Tag, which is what an application limiting the document to what it annotated opts in
@Hidden or
through @Operation(hidden = true) The name of the request parameter an action parameter is bound from: the one
@RequestParameter names, or its own.
The request parameters an action binds by name: the parameters of a simple type. Their names are only known where the application is compiled to keep them.