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(java.util.List<ParameterDescriptor> descriptors)
Creates a new
RequestParametersSnippet that will document the request's
parameters using the given descriptors. |
protected |
RequestParametersSnippet(java.util.List<ParameterDescriptor> descriptors,
boolean ignoreUndocumentedParameters)
Creates a new
RequestParametersSnippet that will document the request's
parameters using the given descriptors. |
protected |
RequestParametersSnippet(java.util.List<ParameterDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates a new
RequestParametersSnippet that will document the request's
parameters using the given descriptors. |
protected |
RequestParametersSnippet(java.util.List<ParameterDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.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(java.util.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 java.util.Set<java.lang.String> |
extractActualParameters(Operation operation)
Extracts the names of the parameters that were present in the given
operation. |
protected void |
verificationFailed(java.util.Set<java.lang.String> undocumentedParameters,
java.util.Set<java.lang.String> missingParameters)
Called when the documented parameters do not match the actual parameters.
|
createModel, createModelForDescriptor, getParameterDescriptorsdocument, getAttributes, getSnippetNameprotected RequestParametersSnippet(java.util.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(java.util.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(java.util.List<ParameterDescriptor> descriptors, java.util.Map<java.lang.String,java.lang.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(java.util.List<ParameterDescriptor> descriptors, java.util.Map<java.lang.String,java.lang.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(java.util.Set<java.lang.String> undocumentedParameters,
java.util.Set<java.lang.String> missingParameters)
AbstractParametersSnippetverificationFailed in class AbstractParametersSnippetundocumentedParameters - the parameters that were found in the operation but
were not documentedmissingParameters - the parameters that were documented but were not found in
the operationprotected java.util.Set<java.lang.String> extractActualParameters(Operation operation)
AbstractParametersSnippetoperation.extractActualParameters in class AbstractParametersSnippetoperation - 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(java.util.List<ParameterDescriptor> additionalDescriptors)
RequestParametersSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors.additionalDescriptors - the additional descriptors