Copyright | (c) Frederick Pringle 2025 |
---|---|
License | BSD-3-Clause |
Maintainer | frederick.pringle@fpringle.com |
Safe Haskell | None |
Language | Haskell2010 |
Servant.API.Routes.Internal.Route
Contents
Description
Internal module, subject to change.
Synopsis
- data Route = Route {}
- newtype RouteDescription = RouteDescription {}
- newtype RouteSummary = RouteSummary {}
- routeMethod :: Lens' Route Method
- routePath :: Lens' Route Path
- routeParams :: Lens' Route (Set Param)
- routeRequestHeaders :: Lens' Route (Set HeaderRep)
- routeRequestBody :: Lens' Route Request
- routeResponse :: Lens' Route Responses
- routeAuths :: Lens' Route (Set Auth)
- routeDescription :: Lens' Route (Maybe RouteDescription)
- routeSummary :: Lens' Route (Maybe RouteSummary)
API routes
A simple representation of a single endpoint of an API.
Constructors
Route | |
Fields |
newtype RouteDescription Source #
Description of a route. This will correspond to the Servant Description
combinator.
It should be noted that the HasRoutes
behaviour for Description
diverges from that in
servant-openapi3
, in the case that one EP has multiple Description
combinators.
For example, given the following API:
type MyAPI = "transaction" :> TransactionAPI :<|> "user" :> Description "User sub-API" :> ( Description "Get my user" :> Get '[JSON] User :<|> "list" :> Get '[JSON] [User] )
The Operation
that servant-openapi
generates for the GET /user
endpoint will have the two
Description
s mappend
-ed together: "User sub-APIGet my user"
.
The corresponding Route
will take the most specific RouteDescription
: "Get my user"
.
Constructors
RouteDescription | |
Fields |
Instances
newtype RouteSummary Source #
Short summary of a route. This will correspond to the Servant Summary
combinator.
The behaviour described for RouteDescription
is the same for RouteSummary
.
Constructors
RouteSummary | |