Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Servant.Lint
Documentation
lintAPI :: forall api. Lintable api => IO () Source #
Pass your API type for lint errors thrown in IO This is typically useful for testing
lintAPI' :: forall api. Lintable api => [Error] Source #
Pass your API type for lint errors as Chunks
Chunks are colored terminal bits from Text.Colour
for making
pretty errors.
printLintAPI :: forall api. Lintable api => IO () Source #
Pass your API type for lint via putStrLn
in stdout
Pretty errors via Text.Colour
A term level representation of the API Its defined recursive to flatten the API to a list of routes instead of a tree
Constructors
class Lintable a where Source #
The Lintable type class describes how to go from a Servant Combinator to a Path
This is essentially a function from `Type -> [Path]`
If you have custom Servant Combinators you may need to add an instance of Lintable for your Combinator, typically ignoring the custom Combinator.
Instances
(Lintable a, Lintable b) => Lintable (a :<|> b) Source # | |
Defined in Servant.Lint | |
ReflectMethod method => Lintable (NoContentVerb method) Source # | |
Defined in Servant.Lint | |
(KnownSymbol a, Lintable b) => Lintable (a :> b) Source # | |
Defined in Servant.Lint | |
(Lintable b, KnownSymbol hint, Typeable a) => Lintable (Capture' _mods hint a :> b) Source # | |
Defined in Servant.Lint | |
(Lintable b, KnownSymbol hint, Typeable a) => Lintable (CaptureAll hint a :> b) Source # | |
Defined in Servant.Lint | |
(Lintable b, KnownSymbol hint, Typeable a) => Lintable (QueryParam hint a :> b) Source # | |
Defined in Servant.Lint | |
(Lintable b, KnownSymbol hint, Typeable a) => Lintable (QueryParams hint a :> b) Source # | |
Defined in Servant.Lint | |
(Lintable b, Typeable a) => Lintable (ReqBody' _mods _ms a :> b) Source # | |
Defined in Servant.Lint | |
(Typeable ret, ReflectMethod method, KnownNat code) => Lintable (Verb method code _cs ret) Source # | |
Defined in Servant.Lint |
This is a striped down version of the Path
focusing on removing details that ambiguate routes
Constructors
ACapture | |
ACaptureAll | |
AQueryParam String | |
APath String | |
AReqBody | |
AVerb ByteString Integer |
Instances
unlinesChunks :: [[Chunk]] -> [Chunk] Source #
Exported for testing only