Skip to main content

Crate aspero_json

Crate aspero_json 

Source
Expand description

aspero’s JSON contract: the shapes agents and apps read, shared by the CLI and any other front end so they can’t drift.

Fields are omitted when unknown rather than null; the lean default set is enough to identify and cite, and full adds everything known. Every result echoes what it answers (input, a claim’s key), so results can arrive in any order.

Structs§

ClaimInput
A claim as an agent would write it, one JSON object per stdin line. Unknown keys are rejected so typos aren’t silently ignored.
InputClaim
A claim with the input it came from and the caller’s key, or why that input isn’t one.

Enums§

Status
How a lookup ended, as its item’s status says.

Functions§

candidate
A scored candidate: confidence, per-field checks, who found it, and the work (with every identifier merged records asserted).
disagreements
Where a record contradicts its DOI’s registry: [{field, value, <registry>: registry_value}].
input_lookup
One input’s lookup, with whatever extras were asked for.
invalid
An input that isn’t an identifier.
invalid_claim
A claim that couldn’t be read, after its echo.
lookup_item
One result. Attempts are included when nothing was found (so the caller sees why) or with full.
mention
One mention: where it is, the identifier, and how it was written.
merged
base with extra’s fields added (both JSON objects).
set_abstract
Sets a work’s abstract (null when none was found) and abstract_source.
usage
usage_one
verification
One verification, after the claim’s echo (input, key, claim).
work
One work: lean by default, every known field with full.