Skip to main content

Module annotations

Module annotations 

Source
Expand description

Spikard’s HTTP annotation grammar, parsed out of scythe’s CustomAnnotation slice. Scythe captures every unknown -- @<name> <value> line verbatim; spikard owns the vocabulary that turns those triples into route metadata.

Structs§

HttpAnnotations
Parsed HTTP metadata for a single SQL query.

Enums§

AnnotationParseError
Errors raised while parsing HTTP annotations. Each variant carries the 1-based source line from the originating CustomAnnotation so messages can point users at the offending SQL.
ApiKeyLocation
AuthRequirement
Authentication requirement attached to a route, mapping directly to spikard’s existing SecuritySchemeInfo enum (bearer-style HTTP auth or API-key auth).
HttpMethod
HTTP method extracted from @http <METHOD> <PATH>.
HttpParamBinding
Where an HTTP request parameter is sourced from.

Functions§

default_status_for
Validate that the HTTP method declared on a query is compatible with the scythe QueryCommand, and return the default status code for the (command, method) pair when HttpAnnotations::status_codes is empty.
parse_for_query
Convenience: parse the HTTP annotations on an AnalyzedQuery AND validate the command/method combination in one call. Returns Ok(None) when the query has no @http directive.
parse_http_annotations
Parse spikard’s HTTP vocabulary out of the custom-annotation slice that scythe captured. Returns Ok(None) when no @http directive is present — queries without HTTP semantics co-exist in the same source tree.