ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Server.RouteSpec

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 capability manifest needs. A write route contributes PUT. A read route contributes both GET and its derived bodiless HEAD operation. The capture type, builder, and typed response value disappear, but each operation's ResponseDocs are projected from the same ResponseContract runtime dispatch uses.

Synopsis

The documented view

data RouteSpec Source #

One served HTTP operation: its name, exact method, path template, prose, request, and response documents.

Not Eq/ Show: response and request schemas may carry autodocodec codecs, which are functions.

Constructors

RouteSpec 

Fields

data PathSeg Source #

One literal or captured path segment.

Constructors

Lit Text 
Param ParamSpec 

Instances

Instances details
Show PathSeg Source # 
Instance details

Defined in Ecluse.Core.Server.RouteSpec

Eq PathSeg Source # 
Instance details

Defined in Ecluse.Core.Server.RouteSpec

Methods

(==) :: PathSeg -> PathSeg -> Bool #

(/=) :: PathSeg -> PathSeg -> Bool #

data ParamSpec Source #

A named path parameter and its human-facing description.

Constructors

ParamSpec 

Fields

Instances

Instances details
Show ParamSpec Source # 
Instance details

Defined in Ecluse.Core.Server.RouteSpec

Eq ParamSpec Source # 
Instance details

Defined in Ecluse.Core.Server.RouteSpec

Projection from a route

specsOf :: Route v -> [RouteSpec] Source #

Project a route to every exact method it serves. The HEAD contract is the bodilessContract interpretation of the same response value used by GET, so its status set cannot drift and neither its manifest nor wire response can carry a body.