pub struct SchemaObject {Show 61 fields
pub schema_dialect: Option<String>,
pub id: Option<String>,
pub reference: Option<String>,
pub anchor: Option<String>,
pub dynamic_ref: Option<String>,
pub dynamic_anchor: Option<String>,
pub comment: Option<String>,
pub defs: Map<Schema>,
pub all_of: Option<Vec<Schema>>,
pub any_of: Option<Vec<Schema>>,
pub one_of: Option<Vec<Schema>>,
pub not: Option<Box<Schema>>,
pub if_schema: Option<Box<Schema>>,
pub then_schema: Option<Box<Schema>>,
pub else_schema: Option<Box<Schema>>,
pub dependent_schemas: Map<Schema>,
pub prefix_items: Option<Vec<Schema>>,
pub items: Option<Box<Schema>>,
pub contains: Option<Box<Schema>>,
pub properties: Map<Schema>,
pub pattern_properties: Map<Schema>,
pub additional_properties: Option<Box<Schema>>,
pub property_names: Option<Box<Schema>>,
pub unevaluated_items: Option<Box<Schema>>,
pub unevaluated_properties: Option<Box<Schema>>,
pub ty: Option<TypeSet>,
pub const_value: Option<Value>,
pub enumeration: Option<Vec<Value>>,
pub multiple_of: Option<f64>,
pub maximum: Option<f64>,
pub exclusive_maximum: Option<f64>,
pub minimum: Option<f64>,
pub exclusive_minimum: Option<f64>,
pub max_length: Option<u64>,
pub min_length: Option<u64>,
pub pattern: Option<String>,
pub max_items: Option<u64>,
pub min_items: Option<u64>,
pub unique_items: Option<bool>,
pub max_contains: Option<u64>,
pub min_contains: Option<u64>,
pub max_properties: Option<u64>,
pub min_properties: Option<u64>,
pub required: Option<Vec<String>>,
pub dependent_required: Map<Vec<String>>,
pub format: Option<String>,
pub content_encoding: Option<String>,
pub content_media_type: Option<String>,
pub content_schema: Option<Box<Schema>>,
pub title: Option<String>,
pub description: Option<String>,
pub default: Option<Value>,
pub deprecated: Option<bool>,
pub read_only: Option<bool>,
pub write_only: Option<bool>,
pub examples: Option<Vec<Value>>,
pub discriminator: Option<Discriminator>,
pub xml: Option<Xml>,
pub external_docs: Option<ExternalDocumentation>,
pub example: Option<Value>,
pub unknown_keywords: Map<Value>,
}Expand description
A schema with keywords.
Keywords are grouped below in the order the JSON Schema 2020-12 specification presents them: core, applicator, unevaluated, validation, format, content, metadata; then the four keywords of the OAS base vocabulary.
Unrecognized keywords are preserved in
unknown_keywords rather than dropped,
because JSON Schema is extensible by design and a description parsed from an
external source must round-trip.
Fields§
§schema_dialect: Option<String>The dialect this schema resource is written in.
Permitted only on a schema resource root. When absent, the document’s
json_schema_dialect applies.
id: Option<String>The base URI of this schema resource.
reference: Option<String>A reference to another schema, applied together with any siblings.
anchor: Option<String>A plain-name fragment identifying this schema within its resource.
dynamic_ref: Option<String>A reference resolved dynamically against the evaluation path.
dynamic_anchor: Option<String>A dynamic anchor, the target of a $dynamicRef.
comment: Option<String>A comment for maintainers, carrying no validation effect.
defs: Map<Schema>Reusable subschemas.
These are not visible to OpenAPI component-name resolution: a
Discriminator implicit mapping and a #/components/schemas lookup
cannot see entries defined here.
all_of: Option<Vec<Schema>>The instance must validate against every subschema.
any_of: Option<Vec<Schema>>The instance must validate against at least one subschema.
one_of: Option<Vec<Schema>>The instance must validate against exactly one subschema.
not: Option<Box<Schema>>The instance must not validate against this subschema.
if_schema: Option<Box<Schema>>The condition of a conditional schema.
then_schema: Option<Box<Schema>>Applied when if_schema succeeds.
else_schema: Option<Box<Schema>>Applied when if_schema fails.
dependent_schemas: Map<Schema>Schemas applied when a given property is present.
prefix_items: Option<Vec<Schema>>Schemas applied to the array items at the corresponding positions.
items: Option<Box<Schema>>The schema applied to array items past
prefix_items.
contains: Option<Box<Schema>>At least one array item must validate against this schema.
properties: Map<Schema>Schemas applied to named object properties.
pattern_properties: Map<Schema>Schemas applied to properties whose names match a regular expression.
additional_properties: Option<Box<Schema>>The schema applied to properties matched by no other applicator.
property_names: Option<Box<Schema>>A schema every property name must validate against.
unevaluated_items: Option<Box<Schema>>Applied to array items no other applicator evaluated.
unevaluated_properties: Option<Box<Schema>>Applied to properties no other applicator evaluated.
ty: Option<TypeSet>The permitted primitive type or types.
const_value: Option<Value>The instance must equal this value.
enumeration: Option<Vec<Value>>The instance must equal one of these values.
multiple_of: Option<f64>The number must be a multiple of this value.
maximum: Option<f64>The inclusive upper bound of a number.
exclusive_maximum: Option<f64>The exclusive upper bound of a number.
A number from OpenAPI 3.1 onward. In 3.0 this was a boolean modifying
maximum; that form must never be emitted.
minimum: Option<f64>The inclusive lower bound of a number.
exclusive_minimum: Option<f64>The exclusive lower bound of a number.
max_length: Option<u64>The maximum length of a string, in Unicode scalar values.
min_length: Option<u64>The minimum length of a string, in Unicode scalar values.
pattern: Option<String>An ECMA-262 regular expression the string must match.
max_items: Option<u64>The maximum number of array items.
min_items: Option<u64>The minimum number of array items.
unique_items: Option<bool>Whether array items must be pairwise distinct.
max_contains: Option<u64>The maximum number of items matching contains.
min_contains: Option<u64>The minimum number of items matching contains.
max_properties: Option<u64>The maximum number of object properties.
min_properties: Option<u64>The minimum number of object properties.
required: Option<Vec<String>>The names of properties that must be present.
dependent_required: Map<Vec<String>>Properties required when a given property is present.
format: Option<String>A semantic format annotation such as date-time or uuid.
Non-validating by default. OpenAPI itself defines only int32, int64,
float, double and password; everything else comes from the OAI
Format Registry and support for it is optional.
content_encoding: Option<String>How the string is encoded, such as base64.
Together with content_media_type
this replaces the OpenAPI 3.0 format: binary, which must never be
emitted.
content_media_type: Option<String>The media type of the string’s decoded contents.
content_schema: Option<Box<Schema>>A schema for the string’s decoded contents.
title: Option<String>A short title for the schema.
description: Option<String>A description of the schema. CommonMark syntax may be used.
default: Option<Value>The default value for the described instance.
deprecated: Option<bool>Whether the described instance is deprecated.
read_only: Option<bool>The instance is sent by the server but not accepted from the client.
write_only: Option<bool>The instance is accepted from the client but not sent by the server.
examples: Option<Vec<Value>>Example instances.
An array, per JSON Schema. This supersedes the OAS
example field.
discriminator: Option<Discriminator>Polymorphism support for oneOf, anyOf and allOf.
xml: Option<Xml>Metadata describing the XML representation of this schema.
external_docs: Option<ExternalDocumentation>Additional external documentation for this schema.
example: Option<Value>use examples, which the specification supersedes this with
A single example instance.
Deprecated by the specification in favour of
examples. Present so that parsed
descriptions round-trip; Kynos does not emit it.
unknown_keywords: Map<Value>Keywords not recognized by this model.
Note that inside a Schema Object — and nowhere else — extensions are
permitted to omit the x- prefix, so this map is not purely a
specification-extension container.