public class RequestBodySnippet extends AbstractBodySnippet
Snippet that documents the body of a request.| Constructor and Description |
|---|
RequestBodySnippet()
Creates a new
RequestBodySnippet. |
RequestBodySnippet(java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates a new
RequestBodySnippet with the given additional
attributes that will be included in the model during template rendering. |
RequestBodySnippet(PayloadSubsectionExtractor<?> subsectionExtractor)
Creates a new
RequestBodySnippet that will document the subsection of the
request body extracted by the given subsectionExtractor. |
RequestBodySnippet(PayloadSubsectionExtractor<?> subsectionExtractor,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates a new
RequestBodySnippet that will document the subsection of the
request body extracted by the given subsectionExtractor. |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
getContent(Operation operation)
Returns the content of the request or response extracted from the given
operation. |
protected org.springframework.http.MediaType |
getContentType(Operation operation)
Returns the content type of the request or response extracted from the given
operation. |
createModeldocument, getAttributes, getSnippetNamepublic RequestBodySnippet()
RequestBodySnippet.public RequestBodySnippet(PayloadSubsectionExtractor<?> subsectionExtractor)
RequestBodySnippet that will document the subsection of the
request body extracted by the given subsectionExtractor.subsectionExtractor - the subsection extractorpublic RequestBodySnippet(java.util.Map<java.lang.String,java.lang.Object> attributes)
RequestBodySnippet with the given additional
attributes that will be included in the model during template rendering.attributes - The additional attributespublic RequestBodySnippet(PayloadSubsectionExtractor<?> subsectionExtractor, java.util.Map<java.lang.String,java.lang.Object> attributes)
RequestBodySnippet that will document the subsection of the
request body extracted by the given subsectionExtractor. The given
additional attributes that will be included in the model during template
rendering.subsectionExtractor - the subsection extractorattributes - The additional attributesprotected byte[] getContent(Operation operation) throws java.io.IOException
AbstractBodySnippetoperation.getContent in class AbstractBodySnippetoperation - The operationjava.io.IOException - if the content cannot be extractedprotected org.springframework.http.MediaType getContentType(Operation operation)
AbstractBodySnippetoperation.getContentType in class AbstractBodySnippetoperation - The operation