<@UHVDR4BNZ> It should match the number of args ok...
# http4k
d
@Nezteb It should match the number of args ok. Can you post more of the code? (Including the full path)
n
d
The sig of the function to create the handler only takes the path parts as args
Where will the orgId and CWI come from?
Guessing that the orgid is the path?
n
orgId will be in the path, CWI will be a JSON object in the Body. does the contract need to specify those before it can be mapped to the function?
d
So it matches the greet example here. https://www.http4k.org/guide/modules/contracts/
The path arg needs to be mapped in the spec. The body lens you will use manually to extract from the request
If you want it to appear in the contract (OpenAPI) then it will also need to be added to the Meta block
n
Ohhhhh, I see. So body arguments are not taken as function arguments. They use lenses on the request.
except for Path/Query/Header params, correect?
d
Only the path parameters make up that signature. The rest are retrieved.manually.
(once again, this is down to the inability to create types with varying generic args)
n
Got it. That makes sense. 😄
d
🙃