Package com.linecorp.armeria.server.docs
Interface DocServicePlugin
Generates the
ServiceSpecification
s of the supported Service
s.-
Method Summary
Modifier and TypeMethodDescriptiongenerateSpecification
(Set<ServiceConfig> serviceConfigs, DocServiceFilter filter, DescriptiveTypeInfoProvider descriptiveTypeInfoProvider) Generates a newServiceSpecification
that provides the information about the supportedService
s.guessServiceMethodName
(Object exampleRequest) Guesses the name of the service method who handles the specified example request.guessServiceName
(Object exampleRequest) Guesses the name of the service who handles the specified example request.default Map
<String, DescriptionInfo> loadDocStrings
(Set<ServiceConfig> serviceConfigs) Loads theDescriptionInfo
that describes services and their methods, enums and their values and that describes services and their methods, enums and their values and structs/exceptions and their fields.name()
Returns the name of this plugin.serializeExampleRequest
(String serviceName, String methodName, Object exampleRequest) Serializes the specified example request into a string.Returns theSet
of the example request types supported by this plugin.
-
Method Details
-
name
String name()Returns the name of this plugin. -
supportedServiceTypes
-
generateSpecification
ServiceSpecification generateSpecification(Set<ServiceConfig> serviceConfigs, DocServiceFilter filter, DescriptiveTypeInfoProvider descriptiveTypeInfoProvider) Generates a newServiceSpecification
that provides the information about the supportedService
s.- Parameters:
serviceConfigs
- theServiceConfig
s of theService
s that are instances of thesupportedServiceTypes()
filter
- theDocServiceFilter
that checks whether a method will be included while buildingDocService
descriptiveTypeInfoProvider
- theDescriptiveTypeInfoProvider
to create aDescriptiveTypeInfo
from a type descriptor.
-
loadDocStrings
Loads theDescriptionInfo
that describes services and their methods, enums and their values and that describes services and their methods, enums and their values and structs/exceptions and their fields. TheMap
returned by this method will contain the documentation strings identified by the key strings that conforms to one of the following formats:"{service name}"
- a docstring that describes a service"{service name}/{method name}"
- a docstring that describes a service method"{service name}/{method name}/{parameter name}"
- a docstring that describes a service method parameter"{type name}"
- a docstring that describes an enum, a struct or an exception"{type name}/{field name}"
- a docstring that describes a field of an enum, a struct or an exception
-
supportedExampleRequestTypes
Returns theSet
of the example request types supported by this plugin. -
guessServiceName
Guesses the name of the service who handles the specified example request.- Parameters:
exampleRequest
- the example request object which is an instance of one of theClass
es returned bysupportedExampleRequestTypes()
- Returns:
- the service name, or
null
if failed to guess.
-
guessServiceMethodName
Guesses the name of the service method who handles the specified example request.- Parameters:
exampleRequest
- the example request object which is an instance of one of theClass
es returned bysupportedExampleRequestTypes()
- Returns:
- the service method name, or
null
if failed to guess.
-
serializeExampleRequest
@Nullable default @Nullable String serializeExampleRequest(String serviceName, String methodName, Object exampleRequest) Serializes the specified example request into a string.- Parameters:
serviceName
- the name of the servicemethodName
- the name of the methodexampleRequest
- the example request- Returns:
- the serialized example, or
null
if not able to serialize.
-