public class RequestParametersSnippet extends AbstractParametersSnippet
Snippet
that documents the request parameters supported by a RESTful
resource.
Request parameters are sent as part of the query string or as POSTed form data.
Modifier | Constructor and Description |
---|---|
protected |
RequestParametersSnippet(List<ParameterDescriptor> descriptors)
Creates a new
RequestParametersSnippet that will document the request's
parameters using the given descriptors . |
protected |
RequestParametersSnippet(List<ParameterDescriptor> descriptors,
boolean ignoreUndocumentedParameters)
Creates a new
RequestParametersSnippet that will document the request's
parameters using the given descriptors . |
protected |
RequestParametersSnippet(List<ParameterDescriptor> descriptors,
Map<String,Object> attributes)
Creates a new
RequestParametersSnippet that will document the request's
parameters using the given descriptors . |
protected |
RequestParametersSnippet(List<ParameterDescriptor> descriptors,
Map<String,Object> attributes,
boolean ignoreUndocumentedParameters)
Creates a new
RequestParametersSnippet that will document the request's
parameters using the given descriptors . |
Modifier and Type | Method and Description |
---|---|
RequestParametersSnippet |
and(List<ParameterDescriptor> additionalDescriptors)
Returns a new
RequestParametersSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors . |
RequestParametersSnippet |
and(ParameterDescriptor... additionalDescriptors)
Returns a new
RequestParametersSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors . |
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.
|
createModel, createModelForDescriptor, getFieldDescriptors, getParameterDescriptors
document, getAttributes, getSnippetName
protected RequestParametersSnippet(List<ParameterDescriptor> descriptors)
RequestParametersSnippet
that will document the request's
parameters using the given descriptors
. Undocumented parameters will
trigger a failure.descriptors
- the parameter descriptorsprotected RequestParametersSnippet(List<ParameterDescriptor> descriptors, boolean ignoreUndocumentedParameters)
RequestParametersSnippet
that will document the request's
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 RequestParametersSnippet(List<ParameterDescriptor> descriptors, Map<String,Object> attributes)
RequestParametersSnippet
that will document the request's
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 RequestParametersSnippet(List<ParameterDescriptor> descriptors, Map<String,Object> attributes, boolean ignoreUndocumentedParameters)
RequestParametersSnippet
that will document the request's
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 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 operationprotected Set<String> extractActualParameters(Operation operation)
AbstractParametersSnippet
operation
.extractActualParameters
in class AbstractParametersSnippet
operation
- the operationpublic RequestParametersSnippet and(ParameterDescriptor... additionalDescriptors)
RequestParametersSnippet
configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors
.additionalDescriptors
- the additional descriptorspublic RequestParametersSnippet and(List<ParameterDescriptor> additionalDescriptors)
RequestParametersSnippet
configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors
.additionalDescriptors
- the additional descriptors