public class ResponseBodySnippet extends AbstractBodySnippet
Snippet that documents the body of a response.| Constructor and Description |
|---|
ResponseBodySnippet()
Creates a new
ResponseBodySnippet. |
ResponseBodySnippet(java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates a new
ResponseBodySnippet with the given additional
attributes that will be included in the model during template rendering. |
ResponseBodySnippet(PayloadSubsectionExtractor<?> subsectionExtractor)
Creates a new
ResponseBodySnippet that will document the subsection of the
response body extracted by the given subsectionExtractor. |
ResponseBodySnippet(PayloadSubsectionExtractor<?> subsectionExtractor,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates a new
ResponseBodySnippet that will document the subsection of the
response 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 ResponseBodySnippet()
ResponseBodySnippet.public ResponseBodySnippet(PayloadSubsectionExtractor<?> subsectionExtractor)
ResponseBodySnippet that will document the subsection of the
response body extracted by the given subsectionExtractor.subsectionExtractor - the subsection extractorpublic ResponseBodySnippet(java.util.Map<java.lang.String,java.lang.Object> attributes)
ResponseBodySnippet with the given additional
attributes that will be included in the model during template rendering.attributes - The additional attributespublic ResponseBodySnippet(PayloadSubsectionExtractor<?> subsectionExtractor, java.util.Map<java.lang.String,java.lang.Object> attributes)
ResponseBodySnippet that will document the subsection of the
response 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