Allow to specify hints with the functional web API
The most common use case is specifying JSON views. ServerResponse.BodyBuilder#hint(String, Object) allows to specify response body serialization hints. ServerRequest#body(BodyExtractor, Map) allows to specify request body extraction hints. Issue: SPR-15030
This commit is contained in:
@@ -50,7 +50,7 @@ import org.springframework.util.MimeTypeUtils;
|
||||
public class ServerSentEventHttpMessageWriter implements HttpMessageWriter<Object> {
|
||||
|
||||
/**
|
||||
* Server-Sent Events hint expecting a {@link Boolean} value which when set to true
|
||||
* Server-Sent Events hint key expecting a {@link Boolean} value which when set to true
|
||||
* will adapt the content in order to comply with Server-Sent Events recommendation.
|
||||
* For example, it will append "data:" after each line break with data encoders
|
||||
* supporting it.
|
||||
|
||||
@@ -38,6 +38,11 @@ import org.springframework.util.MimeType;
|
||||
*/
|
||||
public class AbstractJackson2Codec {
|
||||
|
||||
/**
|
||||
* Hint key to use with a {@link Class} value specifying the JSON View to use to serialize
|
||||
* or deserialize an object.
|
||||
* @see <a href="http://wiki.fasterxml.com/JacksonJsonViews">Jackson JSON Views</a>
|
||||
*/
|
||||
public static final String JSON_VIEW_HINT = AbstractJackson2Codec.class.getName() + ".jsonView";
|
||||
|
||||
protected static final List<MimeType> JSON_MIME_TYPES = Arrays.asList(
|
||||
|
||||
Reference in New Issue
Block a user