I want to extend plone.restapi
serialization to allow selection of per-request serializer selection as follows:
- if a
GET
request for a page passes a parameterrichtext=raw
is passed in querystring, andcollective.exportimport
is installed, a subscriber to a publication event (e.g.IPubStart
orIPubAfterTraversal
), mark request object withcollective.exportimport.interfaces.IRawRichTextMarker
— expected result should be raw stored text from rich text field, untransformed. - If
GET
request for a page passes parameterrichtext=mycustomthing
(or similar), I likewise mark a custom marker interface to trigger use of a custom serializer of my own construction.
My larger goal is having text authored in Plone, exposed over GET
request via plone.restapi
but suitable for consumption in multiple other systems — with the idea that extending an out-of-the-box API is preferable design to maintaining custom views that do the same thing. I want to double-check that I am not missing some more obvious extension mechanism to pivot serialization per-request in plone.restapi
?