Skip to main content

Module model

Module model 

Source
Expand description

The document, reduced to the facts a CLI and a typed caller both need.

Document::load takes the two files an adopter ships — the vendor’s OpenAPI document and their Overlay of corrections — and hands back a list of Operations with every $ref already resolved. Nothing from openapiv3 escapes this module: after load returns, the parsed document is dropped.

Reducing a document is bless-time work, not startup work, and the document feature is what says so in the manifest. A bless step enables it, calls Document::load once and Document::to_blob on the result; the binary it produces leaves it off, calls Document::from_blob, and has no reader compiled into it to read YAML with. The two are the same reduction by construction — there is one load — and a test holds the shipped blob to the shipped document to prove the pair was written by the same run.

Structs§

Document
Every operation the document describes, in document order, plus the server it describes them against.
DriftError
A generated inventory and the document it was generated from disagree.
Field
One scalar property of a flat JSON body.
Operation
One operation: one subcommand under one group, one request.
Param
One path, query, or header parameter.

Enums§

Body
What the operation wants in the request body — and therefore which flags the subcommand grows. Each variant is exactly one flag set, so a body can never offer a flag that the request builder then ignores.
DocumentError
The bytes a bless step wrote are not a reduction this crate can read.
Effect
Whether the CLI must hold this operation behind --commit.
LoadError
Reducing an OpenAPI document to Operations failed.
Location
Where a parameter goes in the request.

Constants§

COMMIT
The write gate.
FIELD_PART
One text part of a multipart body.
FILE_PART
One file part of a multipart body.
JSON_BODY
Whole-body flag, for every operation that takes JSON.
RAW_BODY
Whole-body flag, for a media type this CLI does not assemble.