-
Couldn't load subscription status.
- Fork 38.8k
Description
Christopher Smith opened SPR-12096 and commented
Current best practice is to version REST APIs by media type (application/vnd.example.person-v1+json), but the RestTemplate does not provide a simple mechanism for indicating the Accept header for an entity type when using a general-purpose converter (such as Jackson). Instead, the AcceptHeaderRequestCallback will add all potentially matching media types to the Accept header.
It should be possible to annotate an entity class to specify the media type that RestTemplate will request from the server so that older clients will not send an unversioned request that they can't understand:
@EntityMediaType("application/vnd.example.person-v1+json")
public class Person {
// stuff
}
Affects: 4.0.6
Issue Links:
- Introduce proxy-based REST client similar to HttpInvokerProxyFactoryBean [SPR-12131] #16747 Introduce proxy-based REST client similar to HttpInvokerProxyFactoryBean
0 votes, 5 watchers