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:
RFC3339 date string to java.util.Date object
plain text password to some encrypted string
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.
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.