Add support for QUERY verb (RFC 10008) - #1907
Conversation
| tcharPunctuation :: [Word8] | ||
| tcharPunctuation = [33, 35, 36, 37, 38, 39, 42, 43, 45, 46, 94, 95, 96, 124, 126] | ||
|
|
||
| space, horizontalTab, doubleQuote, percent, asterisk, plus, comma, hyphen, period, slash, colon, semicolon, equals, questionMark, atSign, backslash, underscore, tilde :: Word8 | ||
| space = 32 | ||
| horizontalTab = 9 | ||
| doubleQuote = 34 | ||
| percent = 37 | ||
| asterisk = 42 | ||
| plus = 43 | ||
| comma = 44 | ||
| hyphen = 45 | ||
| period = 46 | ||
| slash = 47 | ||
| colon = 58 | ||
| semicolon = 59 | ||
| equals = 61 | ||
| questionMark = 63 | ||
| atSign = 64 | ||
| backslash = 92 | ||
| underscore = 95 | ||
| tilde = 126 | ||
|
|
||
| zero, one, nine, capitalA, capitalZ, lowerA, lowerF, lowerZ :: Word8 | ||
| zero = 48 | ||
| one = 49 | ||
| nine = 57 | ||
| capitalA = 65 | ||
| capitalZ = 90 | ||
| lowerA = 97 | ||
| lowerF = 102 | ||
| lowerZ = 122 |
There was a problem hiding this comment.
This can be replaced with use of https://hackage.haskell.org/package/word8, but I'm not sure it worth adding a new dependency
There was a problem hiding this comment.
It's not a new dependency as servant already indirectly depends on word8, so making it a direct dependency isn't going to make any difference as word8 needs to be built to build servant anyway.
Indeed servant-server actually directly depends on word8.
And word8 has no dependencies other than base.
I'm not a servant maintainer but I'd go with the dependency over the copy pasta.
|
I'd also like to see Although I probably wouldn't use it until there was OpenAPI support as well. Problem is that QUERY support needs There is a OpenAPI 3.1 library for Haskell so probably the best bet would be to get that library to support OpenAPI 3.2 also (perhaps by adding some sort of version type parameter). Then once that is done AND this PR is merged, then the associated OpenAPI 3.1 library for Servant could then be upgraded to support OpenAPI 3.2 and the QUERY method in Servant. So a bit of a long road, but this PR is a good start and I hope makes it into servant to encourage work in these other areas. Perhaps one temporary hack to consider is having a servant type or option This is a bit of a hack though and ideally we just have proper ecosystem support for |
Closes #1900.
Summary
QUERYsupport throughVerb,NoContentVerb,UVerb,MultiVerb,Stream, server routing, clients, docs, foreign representations, and QuickCheck.Querystatus aliases and typedAccept-Queryresponse-header support for the RFC 9651 subset required by RFC 10008.http-types >= 0.13 && < 0.14; until 0.13 is released, pin the approved upstream commit for reproducible CI builds.The
Accept-Queryparser intentionally remains field-specific and private: Servant has no other RFC 9651 consumer or suitable reusable dependency, while a generic implementation would require the complete Structured Fields model and conformance suite.Swagger 2 and OpenAPI 3 remain unsupported because neither format defines a
QUERYoperation.