public class PathParametersSnippet extends AbstractParametersSnippet
Snippet
that documents the path parameters supported by a RESTful resource.RequestDocumentation.pathParameters(ParameterDescriptor...)
,
RequestDocumentation.pathParameters(Map, ParameterDescriptor...)
Modifier | Constructor and Description |
---|---|
protected |
PathParametersSnippet(List<ParameterDescriptor> descriptors)
Creates a new
PathParametersSnippet that will document the request's path
parameters using the given descriptors . |
protected |
PathParametersSnippet(List<ParameterDescriptor> descriptors,
boolean ignoreUndocumentedParameters)
Creates a new
PathParametersSnippet that will document the request's path
parameters using the given descriptors . |
protected |
PathParametersSnippet(List<ParameterDescriptor> descriptors,
Map<String,Object> attributes)
Creates a new
PathParametersSnippet that will document the request's path
parameters using the given descriptors . |
protected |
PathParametersSnippet(List<ParameterDescriptor> descriptors,
Map<String,Object> attributes,
boolean ignoreUndocumentedParameters)
Creates a new
PathParametersSnippet that will document the request's path
parameters using the given descriptors . |
Modifier and Type | Method and Description |
---|---|
PathParametersSnippet |
and(List<ParameterDescriptor> additionalDescriptors)
Returns a new
PathParametersSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors . |
PathParametersSnippet |
and(ParameterDescriptor... additionalDescriptors)
Returns a new
PathParametersSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors . |
protected Map<String,Object> |
createModel(Operation operation)
Create the model that should be used during template rendering to document the
given
operation . |
protected Set<String> |
extractActualParameters(Operation operation)
Extracts the names of the parameters that were present in the given
operation . |
protected void |
verificationFailed(Set<String> undocumentedParameters,
Set<String> missingParameters)
Called when the documented parameters do not match the actual parameters.
|
createModelForDescriptor, getFieldDescriptors, getParameterDescriptors
document, getAttributes, getSnippetName
protected PathParametersSnippet(List<ParameterDescriptor> descriptors)
PathParametersSnippet
that will document the request's path
parameters using the given descriptors
. Undocumented parameters will
trigger a failure.descriptors
- the parameter descriptorsprotected PathParametersSnippet(List<ParameterDescriptor> descriptors, boolean ignoreUndocumentedParameters)
PathParametersSnippet
that will document the request's path
parameters using the given descriptors
. If
ignoreUndocumentedParameters
is true
, undocumented parameters will
be ignored and will not trigger a failure.descriptors
- the parameter descriptorsignoreUndocumentedParameters
- whether undocumented parameters should be
ignoredprotected PathParametersSnippet(List<ParameterDescriptor> descriptors, Map<String,Object> attributes)
PathParametersSnippet
that will document the request's path
parameters using the given descriptors
. The given attributes
will
be included in the model during template rendering. Undocumented parameters will
trigger a failure.descriptors
- the parameter descriptorsattributes
- the additional attributesprotected PathParametersSnippet(List<ParameterDescriptor> descriptors, Map<String,Object> attributes, boolean ignoreUndocumentedParameters)
PathParametersSnippet
that will document the request's path
parameters using the given descriptors
. The given attributes
will
be included in the model during template rendering. If
ignoreUndocumentedParameters
is true
, undocumented parameters will
be ignored and will not trigger a failure.descriptors
- the parameter descriptorsattributes
- the additional attributesignoreUndocumentedParameters
- whether undocumented parameters should be
ignoredprotected Map<String,Object> createModel(Operation operation)
TemplatedSnippet
operation
. Any additional attributes that were supplied when this
TemplatedSnippet
were created will be automatically added to the model
prior to rendering.createModel
in class AbstractParametersSnippet
operation
- The operationprotected Set<String> extractActualParameters(Operation operation)
AbstractParametersSnippet
operation
.extractActualParameters
in class AbstractParametersSnippet
operation
- the operationprotected void verificationFailed(Set<String> undocumentedParameters, Set<String> missingParameters)
AbstractParametersSnippet
verificationFailed
in class AbstractParametersSnippet
undocumentedParameters
- the parameters that were found in the operation but
were not documentedmissingParameters
- the parameters that were documented but were not found in
the operationpublic final PathParametersSnippet and(ParameterDescriptor... additionalDescriptors)
PathParametersSnippet
configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors
.additionalDescriptors
- the additional descriptorspublic final PathParametersSnippet and(List<ParameterDescriptor> additionalDescriptors)
PathParametersSnippet
configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors
.additionalDescriptors
- the additional descriptors