| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Servant.OpenApi
Description
OpenAPI 3 description of ArbiterAPI. The route types
define paths, methods, parameters, bodies, responses, and status codes.
RegistryToAPI expands to the server route tree and includes each queue by
its registry name with its payload and result schemas.
Each payload requires a ToSchema instance. For generic JSON, use
deriving anyclass (ToSchema). This module defines a Value
instance for free-form payloads.
Handwritten schemas are present for handwritten JSON encodings. Each schema applies the applicable record constructor. Missing, misordered, or incorrect field types cause a compile error. Generic encodings use generic schemas.
Synopsis
- openApiSpec :: forall (registry :: JobPayloadRegistry). HasOpenApi (ArbiterAPI registry) => Value
- type OpenApiAPI = "openapi.json" :> Get '[JSON] Value
- openApiServer :: forall (registry :: JobPayloadRegistry). HasOpenApi (ArbiterAPI registry) => Server OpenApiAPI
The document
Source #openApiSpec :: forall (registry :: JobPayloadRegistry). HasOpenApi (ArbiterAPI registry) => Value
The description of a registry's API, from its route types.
Serving it
Source #type OpenApiAPI = "openapi.json" :> Get '[JSON] Value
The document's own route, for mounting beside ArbiterAPI.
Source #openApiServer :: forall (registry :: JobPayloadRegistry). HasOpenApi (ArbiterAPI registry) => Server OpenApiAPI
Serve the description of a registry's API.