Added an optional mode for RFC 7231 compliance. The Content-Type header is used to...
authorMatthew Laird <lairdm@ebi.ac.uk>
Wed, 22 Nov 2017 11:43:19 +0000 (11:43 +0000)
committerMatthew Laird <lairdm@ebi.ac.uk>
Wed, 22 Nov 2017 11:43:19 +0000 (11:43 +0000)
commitc0008fc76f34cc22ceaf80003191f73a2300bfe5
treea80c2e1d38e7c5057e2a915ff70db3b5efbd5727
parent3b3fd402d25bc1acb7061296960161c71a27a793
Added an optional mode for RFC 7231 compliance. The Content-Type header is used to signal the format of the request body, the Accept header is used to negotiate the content type the client wants. Unfortunately for our needs these are sometimes different, but Catalyst::Controller::REST assumes they always match.

This adds a separation between the Serializer and Deserializer when desired. As well, a separate set of mappings for the deserializer content types is allowed. Probably not the most eligant solution but hopefully doesn't break backwards compatibility for those wanting or expecting the current behaviour.

If you have ideas on a better way to do this, I'm open to suggestions on improvements. Thanks.
lib/Catalyst/Action/Deserialize.pm
lib/Catalyst/Action/SerializeBase.pm
lib/Catalyst/Controller/REST.pm
lib/Catalyst/TraitFor/Request/REST.pm