Package io.swagger.servlet.extensions
Interface ReaderExtension
-
- All Known Implementing Classes:
ServletReaderExtension
public interface ReaderExtension
TheReaderExtension
interface defines methods for scans resources for Swagger.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
applyConsumes(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the consumes from the method's annotations and applies these to the operation.void
applyDescription(io.swagger.models.Operation operation, Method method)
Reads the description from the method's annotations and applies it to the operation.void
applyExtensions(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the extensions from the method's annotations and applies these to the operation.void
applyImplicitParameters(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the implicit parameters from the method's annotations and applies these to the operation.void
applyOperationId(io.swagger.models.Operation operation, Method method)
Reads the operation id from the method's annotations and applies it to the operation.void
applyParameters(ReaderContext context, io.swagger.models.Operation operation, Type type, Annotation[] annotations)
Reads the parameters from the method's annotations and applies these to the operation.void
applyProduces(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the produces from the method's annotations and applies these to the operation.void
applyResponses(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the responses from the method's annotations and applies these to the operation.void
applySchemes(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the schemes from the method's annotations and applies these to the operation.void
applySecurityRequirements(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the security requirement from the method's annotations and applies these to the operation.void
applySummary(io.swagger.models.Operation operation, Method method)
Reads the summary from the method's annotations and applies it to the operation.void
applyTags(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the tags from the method's annotations and applies these to the operation.String
getHttpMethod(ReaderContext context, Method method)
Returns http method.String
getPath(ReaderContext context, Method method)
Returns operation's path.int
getPriority()
Returns this extension's priority.boolean
isReadable(ReaderContext context)
Checks that a resource should be scanned.void
setDeprecated(io.swagger.models.Operation operation, Method method)
Sets the deprecated flag to the operation.
-
-
-
Method Detail
-
getPriority
int getPriority()
Returns this extension's priority. Note: Extension will be executed first with lowest priority.- Returns:
- this extension's priority
-
isReadable
boolean isReadable(ReaderContext context)
Checks that a resource should be scanned.- Parameters:
context
- is the resource context- Returns:
- true if the resource needs to be scanned, otherwise false
-
applyConsumes
void applyConsumes(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the consumes from the method's annotations and applies these to the operation.- Parameters:
context
- is the resource contextoperation
- is the container for the operation datamethod
- is the method for reading annotations
-
applyProduces
void applyProduces(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the produces from the method's annotations and applies these to the operation.- Parameters:
context
- is the resource contextoperation
- is the container for the operation datamethod
- is the method for reading annotations
-
getHttpMethod
String getHttpMethod(ReaderContext context, Method method)
Returns http method.- Parameters:
context
- is the resource contextmethod
- is the method for reading annotations- Returns:
- http method
-
getPath
String getPath(ReaderContext context, Method method)
Returns operation's path.- Parameters:
context
- is the resource contextmethod
- is the method for reading annotations- Returns:
- operation's path
-
applyOperationId
void applyOperationId(io.swagger.models.Operation operation, Method method)
Reads the operation id from the method's annotations and applies it to the operation.- Parameters:
operation
- is the container for the operation datamethod
- is the method for reading annotations
-
applySummary
void applySummary(io.swagger.models.Operation operation, Method method)
Reads the summary from the method's annotations and applies it to the operation.- Parameters:
operation
- is the container for the operation datamethod
- is the method for reading annotations
-
applyDescription
void applyDescription(io.swagger.models.Operation operation, Method method)
Reads the description from the method's annotations and applies it to the operation.- Parameters:
operation
- is the container for the operation datamethod
- is the method for reading annotations
-
applySchemes
void applySchemes(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the schemes from the method's annotations and applies these to the operation.- Parameters:
context
- is the resource contextoperation
- is the container for the operation datamethod
- is the method for reading annotations
-
setDeprecated
void setDeprecated(io.swagger.models.Operation operation, Method method)
Sets the deprecated flag to the operation.- Parameters:
operation
- is the container for the operation datamethod
- is the method for reading annotations
-
applySecurityRequirements
void applySecurityRequirements(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the security requirement from the method's annotations and applies these to the operation.- Parameters:
context
- is the resource contextoperation
- is the container for the operation datamethod
- is the method for reading annotations
-
applyTags
void applyTags(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the tags from the method's annotations and applies these to the operation.- Parameters:
context
- is the resource contextoperation
- is the container for the operation datamethod
- is the method for reading annotations
-
applyResponses
void applyResponses(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the responses from the method's annotations and applies these to the operation.- Parameters:
context
- is the resource contextoperation
- is the container for the operation datamethod
- is the method for reading annotations
-
applyParameters
void applyParameters(ReaderContext context, io.swagger.models.Operation operation, Type type, Annotation[] annotations)
Reads the parameters from the method's annotations and applies these to the operation.- Parameters:
context
- is the resource contextoperation
- is the container for the operation datatype
- is the type of parameterannotations
- are the method's annotations
-
applyImplicitParameters
void applyImplicitParameters(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the implicit parameters from the method's annotations and applies these to the operation.- Parameters:
context
- is the resource contextoperation
- is the container for the operation datamethod
- is the method for reading annotations
-
applyExtensions
void applyExtensions(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the extensions from the method's annotations and applies these to the operation.- Parameters:
context
- is the resource contextoperation
- is the container for the operation datamethod
- is the method for reading annotations
-
-