@Target(value={METHOD,ANNOTATION_TYPE}) @Retention(value=RUNTIME) @Inherited public @interface Operation
Note: swagger-jaxrs2 reader engine includes by default also methods of scanned resources which are not annotated with @Operation, as long as a jax-rs @Path is defined at class and/or method level, together with the http method annotation (@GET, @POST, etc).
This behaviour is controlled by configuration property `scanAllResources` which defaults to true. By setting this
flag to false only @Operation
annotated methods are considered.
The following fields can also alternatively be defined at method level (as repeatable annotations in case of arrays),
in this case method level annotations take precedence over @Operation
annotation fields:
Tag
ExternalDocumentation
Parameter
ApiResponse
SecurityRequirement
Server
Extension
Hidden
Modifier and Type | Optional Element and Description |
---|---|
boolean |
deprecated
Allows an operation to be marked as deprecated.
|
String |
description
A verbose description of the operation.
|
Extension[] |
extensions
The list of optional extensions
|
ExternalDocumentation |
externalDocs
Additional external documentation for this operation.
|
boolean |
hidden
Allows this operation to be marked as hidden
|
boolean |
ignoreJsonView
Ignores JsonView annotations while resolving operations and types.
|
String |
method
The HTTP method for this operation.
|
String |
operationId
The operationId is used by third-party tools to uniquely identify this operation.
|
Parameter[] |
parameters
An optional array of parameters which will be added to any automatically detected parameters in the method itself.
|
RequestBody |
requestBody
Request body associated to the operation.
|
ApiResponse[] |
responses
The list of possible responses as they are returned from executing this operation.
|
SecurityRequirement[] |
security
A declaration of which security mechanisms can be used for this operation.
|
Server[] |
servers
An alternative server array to service this operation.
|
String |
summary
Provides a brief description of this operation.
|
String[] |
tags
Tags can be used for logical grouping of operations by resources or any other qualifier.
|
public abstract String method
public abstract String[] tags
public abstract String summary
public abstract String description
public abstract RequestBody requestBody
public abstract ExternalDocumentation externalDocs
public abstract String operationId
public abstract Parameter[] parameters
public abstract ApiResponse[] responses
public abstract boolean deprecated
public abstract SecurityRequirement[] security
public abstract Server[] servers
public abstract Extension[] extensions
Copyright © 2021. All rights reserved.