Conversation
|
|
||
| -- | If you use @'QueryParamForm' BookSearchParams@ in one of the endpoints for your API, | ||
| -- this automatically requires your server-side handler to be a function | ||
| -- that takes an argument of type @['BookSearchParams']@. |
There was a problem hiding this comment.
Of type @'BookSearchParams'@, right?
| -- > { authors :: [Text] | ||
| -- > , page :: Maybe Int | ||
| -- > } deriving (Generic) | ||
| -- > instance FromForm BookSearchParams |
There was a problem hiding this comment.
We should probably mention that we default implementation uses FromHttpApiData for each field.
| subserver `addParameterCheck` withRequest paramsCheck | ||
| where | ||
| paramsCheck req = | ||
| case urlDecodeAsForm (BL.drop 1 . BL.fromStrict $ rawQueryString req) of |
There was a problem hiding this comment.
I guess BL.drop 1 is about dropping leading ??
Can rawQueryString contain extra info (e.g. HTML anchors?), would it ruin parsing?
|
Also, I don't see any changes for |
|
@fizruk the |
|
@isairz are you going to work on this soon or should we take over? |
|
@fizruk Sorry, I was so busy and did not care. |
#728
This is my first pull request in servant.
Please feel free to review my commits 😃