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§
- Http
Annotations - Parsed HTTP metadata for a single SQL query.
Enums§
- Annotation
Parse Error - Errors raised while parsing HTTP annotations. Each variant carries the
1-based source line from the originating
CustomAnnotationso messages can point users at the offending SQL. - ApiKey
Location - Auth
Requirement - Authentication requirement attached to a route, mapping directly to
spikard’s existing
SecuritySchemeInfoenum (bearer-style HTTP auth or API-key auth). - Http
Method - HTTP method extracted from
@http <METHOD> <PATH>. - Http
Param Binding - 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 whenHttpAnnotations::status_codesis empty. - parse_
for_ query - Convenience: parse the HTTP annotations on an
AnalyzedQueryAND validate the command/method combination in one call. ReturnsOk(None)when the query has no@httpdirective. - parse_
http_ annotations - Parse spikard’s HTTP vocabulary out of the custom-annotation slice that
scythe captured. Returns
Ok(None)when no@httpdirective is present — queries without HTTP semantics co-exist in the same source tree.