| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Server.RouteDescription
Description
The documented operation view of a route, as plain OpenAPI-free data.
specsOf erases an Ecluse.Core.Server.Route.Route into the operations the OpenAPI spec
needs. A write route contributes PUT, a submission route POST, and a removal route
DELETE. A read route contributes both GET and its derived bodiless HEAD operation. The
capture type, builder, and typed response value disappear. Each operation's ResponseDocs
still come from the same ResponseContract runtime dispatch uses.
Synopsis
- data RouteSpec = RouteSpec {
- rsName :: RouteName
- rsMethod :: StdMethod
- rsPattern :: [PathSeg]
- rsSummary :: Text
- rsDescription :: Text
- rsRequest :: Maybe RequestSpec
- rsOutcomes :: [ResponseDoc]
- data PathSeg
- data ParamSpec = ParamSpec {
- psName :: Text
- psDescription :: Text
- specsOf :: Route v -> [RouteSpec]
- catchAllSpecs :: ResponseContract r -> ParamSpec -> NonEmpty RouteSpec
- unsupportedPathParam :: ParamSpec
The documented view
One served HTTP operation, as the manifest documents it. No Eq or Show: request and
response schemas may carry autodocodec codecs, which are functions.
Constructors
| RouteSpec | |
Fields
| |
A named path parameter and its human-facing description.
Constructors
| ParamSpec | |
Fields
| |
Projection from a route
specsOf :: Route v -> [RouteSpec] Source #
Project a route to every exact method it serves. The HEAD contract is the bodilessContract
reading of the response value GET uses, so its status set cannot drift from the GET's.
The synthetic catch-all
catchAllSpecs :: ResponseContract r -> ParamSpec -> NonEmpty RouteSpec Source #
The GET and HEAD pair documenting a mount's deny-by-default catch-all. It is the
absence of a match rather than a route, so no Route carries it and each table appends it.
unsupportedPathParam :: ParamSpec Source #
The catch-all's path parameter, as every mount's route table documents it.