Skip to main content

Module schema

Module schema 

Source
Expand description

Following $refs, and deciding what one schema is worth on a command line.

Requires the document feature.

This is the whole of what this crate understands about JSON Schema: a schema either fits on one flag — it is a Scalar — or it does not, and then the body goes through a file. Nothing richer is modelled, because nothing richer has a command-line spelling.

A $ref is followed before the schema is read, so a property pointed at a named schema carries that schema’s rules onto the flag.

Structs§

RefError
A $ref that does not lead anywhere.

Functions§

description_of
What a property says about itself, and what it inherits by pointing somewhere else.
is_json
application/json, application/merge-patch+json, and anything with parameters after the essence.
is_media_type
Whether this is a media type at all: type/subtype, with optional parameters after a ;.
is_multipart
A media type this crate can assemble from --file and --field parts.
resolve
Follow #/components/<section>/<name> hops until an item appears.
resolve_schema
scalar_of
Some(scalar) when this schema fits on one flag, None when it does not.