cognitect-labs / vase

Data driven microservices
Eclipse Public License 1.0
375 stars 41 forks source link

Added custom params merging to request #13

Closed yokolet closed 8 years ago

yokolet commented 8 years ago

This is a possible solution when form data in body part need some conversions or tweaks before those are transacted to Datomic. The particular problems I have now are:

Both are a part of payload in the body params, {:json-params {:payload [{:petstore.order/shipDate "...."}]}} or {:json-params {:payload [:petstore.user/password "password"]}}. For conversions, those should be read from an input stream.

Once body params are read from the input stream, the stream will be empty. So, the body-params interceptor in vase sets :json-params to nil. This kills converted parameters in a custom interceptor.

This pull request introduces :custom-params key-value handling to a transact action.

There may be a solution allow people to customize interceptors vase will use.

ohpauleez commented 8 years ago

It should be possible to post-process any data through writing your own interceptor and using it in Vase or setting it within the Pedestal routes.