Fork me on GitHub
#yada
<
2017-04-05
>
borkdude15:04:45

I want to allow a special parameter in my request body which I want to collect in an interceptor, remove from the body and the let schema validate as normally. As of now it seems that Yada complects parsing the request body and Schema validation. Would a PR in which parsing and schema validation of the request body are decomplected in two separate interceptors make sense? I could add another defmethod for “application/edn”, “application/json” with my own changed versions of this https://github.com/juxt/yada/blob/master/src/yada/request_body.clj#L100 code, but that would make maintaining code harder.

borkdude15:04:13

I’ll think more about this, maybe I can solve it without changing too much

borkdude15:04:05

Dynamically changing the resource schema to allow the special key is less involved

borkdude15:04:48

Solved it with 2 interceptors, about 20 lines of code

malcolmsparks17:04:09

@borkdude I agree with your point about complecting request body processing and swagger

borkdude17:04:54

s/swagger/Schema/?