#[non_exhaustive]pub enum ValidationError {
Show 100 variants
UnsupportedOpenApiVersion {
version: String,
},
UnsupportedComponentType {
schema: String,
kind: String,
},
MissingComponentSchemaType {
schema: String,
},
MissingObjectProperties {
schema: String,
},
MissingPaths,
UnsupportedEnumType {
context: String,
kind: String,
},
NonArrayEnum {
context: String,
},
EmptyEnum {
context: String,
},
NonStringEnumValue {
context: String,
},
ConstNotInEnum {
context: String,
},
InvalidSatayEnumVariants {
context: String,
},
UnknownSatayEnumVariantValue {
context: String,
wire_name: String,
},
InvalidSatayEnumVariantName {
context: String,
wire_name: String,
},
ReservedSatayEnumVariantName {
context: String,
wire_name: String,
rust_name: String,
},
DuplicateSatayEnumVariantName {
context: String,
rust_name: String,
},
NonArrayRequired {
context: String,
},
NonStringRequiredField {
context: String,
},
UnsupportedIntegerFormat {
context: String,
format: String,
},
UnsupportedNumberFormat {
context: String,
format: String,
},
UnsupportedSatayParseAs {
context: String,
parse_as: String,
},
InvalidSatayParseAs {
context: String,
},
SatayParseAsRequiresString {
context: String,
parse_as: String,
kind: String,
},
UnsupportedSatayIntegerType {
context: String,
integer_type: String,
},
InvalidSatayIntegerType {
context: String,
},
SatayIntegerTypeRequiresInteger {
context: String,
integer_type: String,
kind: String,
},
MissingArrayItems {
context: String,
},
InlineObjectSchema {
context: String,
},
UnsupportedMapObjectSchema {
context: String,
},
UnsupportedSchemaType {
context: String,
kind: String,
},
MissingSchemaType {
context: String,
},
UnsupportedBooleanSchema {
context: String,
},
MultipleNonNullSchemaTypesUnsupported {
context: String,
},
UnsupportedComposition {
context: String,
keyword: &'static str,
},
UnsupportedAllOfSiblingKeyword {
context: String,
keyword: String,
},
UnsupportedAllOfBranch {
context: String,
index: usize,
},
DuplicateAllOfProperty {
context: String,
property: String,
},
RecursiveAllOf {
context: String,
schema: String,
},
RecursiveDiscriminatorBranch {
context: String,
schema: String,
},
UnsupportedAnyOfSiblingKeyword {
context: String,
keyword: String,
},
UnsupportedAnyOfBranch {
context: String,
index: usize,
},
UnsupportedOneOfSiblingKeyword {
context: String,
keyword: String,
},
UnsupportedOneOfBranch {
context: String,
index: usize,
},
DuplicateUnionNullBranch {
context: String,
keyword: &'static str,
index: usize,
},
DuplicateOpenStringEnumValue {
context: String,
value: String,
},
NullableUnionWithoutVariants {
context: String,
keyword: &'static str,
},
ShadowedUnionBranch {
context: String,
keyword: &'static str,
index: usize,
shadowed_by: usize,
},
EmptyAnyOf {
context: String,
},
RecursiveAnyOf {
context: String,
schema: String,
},
InvalidDiscriminatorUnion {
context: String,
},
UnsupportedDiscriminatorBranch {
context: String,
keyword: &'static str,
index: usize,
},
DiscriminatorBranchNotObject {
context: String,
schema: String,
},
DiscriminatorPropertyConflict {
context: String,
schema: String,
property: String,
},
InvalidDiscriminatorProperty {
context: String,
schema: String,
property: String,
expected: &'static str,
},
InvalidDiscriminatorMapping {
context: String,
value: String,
target: String,
},
DuplicateDiscriminatorMapping {
context: String,
schema: String,
},
DiscriminatorMappingValueMismatch {
context: String,
schema: String,
value: String,
actual: String,
},
DuplicateDiscriminatorValue {
context: String,
value: String,
},
InvalidStringLengthBounds {
context: String,
min_length: u64,
max_length: u64,
},
UniqueItemsUnsupported {
context: String,
},
InvalidArrayLengthBounds {
context: String,
min_items: u64,
max_items: u64,
},
UnsupportedKeyword {
context: String,
keyword: &'static str,
},
InvalidNonNegativeIntegerKeyword {
context: String,
keyword: &'static str,
},
InvalidBooleanKeyword {
context: String,
keyword: &'static str,
},
ExclusiveLimitRequiresBound {
context: String,
exclusive_keyword: &'static str,
keyword: &'static str,
},
InvalidFiniteNumberKeyword {
context: String,
keyword: &'static str,
},
ExpectedInteger {
context: String,
},
EmptyIntegerBounds {
context: String,
},
ExclusiveIntegerMinimumOverflow,
ExclusiveIntegerMaximumOverflow,
EmptyNumberBounds {
context: String,
},
MissingOperationResponses {
operation_id: String,
},
ExpectedArray {
context: String,
},
UnsupportedParameterLocation {
context: String,
wire_name: String,
location: String,
},
ContentParameterUnsupported {
context: String,
wire_name: String,
},
MissingParameterSchema {
context: String,
wire_name: String,
},
NullableParameterUnsupported {
wire_name: String,
},
AnyOfParameterUnsupported {
wire_name: String,
},
MapParameterUnsupported {
wire_name: String,
},
ArrayPathParameterUnsupported {
wire_name: String,
},
ArrayHeaderParameterUnsupported {
wire_name: String,
},
PathParameterNotRequired {
wire_name: String,
},
MissingContent {
context: String,
},
MissingJsonContent {
context: String,
},
MissingJsonSchema {
context: String,
},
DefaultResponseBodyUnsupported {
context: String,
},
InvalidStatusCode {
context: String,
status: String,
},
OutOfRangeStatusCode {
context: String,
status_code: u16,
},
MissingResponseJsonContent {
context: String,
status: String,
},
UnclosedPathParameter {
path: String,
},
EmptyPathParameter {
path: String,
},
UndeclaredPathParameter {
path: String,
name: String,
},
UnusedPathParameter {
path: String,
name: String,
},
ResolveReference {
reference: String,
context: String,
source: Box<ValidationError>,
},
NonLocalReference,
InvalidLocalReference,
MissingJsonPointerToken {
token: String,
},
InvalidComponentReference {
reference: String,
section: &'static str,
},
CircularReference {
reference: String,
},
ExpectedObject {
context: String,
},
ExpectedObjectField {
context: String,
field: &'static str,
},
}Expand description
Errors that can occur while validating an OpenAPI document.
This enum is non_exhaustive
so new variants may be added in future releases without a semver break.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnsupportedOpenApiVersion
The OpenAPI version is not supported.
Error message: unsupported OpenAPI version {version}; Satay supports OpenAPI 3.1
UnsupportedComponentType
A schema component uses a type that is not supported.
Error message: unsupported type {kind}in schema{schema}``
MissingComponentSchemaType
A schema component is missing a required type, $ref, enum, or properties declaration.
Error message: schema {schema}must declaretype, $ref, enum, or properties``
MissingObjectProperties
An object schema is missing the required properties field.
Error message: object schema {schema}must declareproperties``
MissingPaths
The OpenAPI document is missing the required paths field.
Error message: OpenAPI document must declare paths``
UnsupportedEnumType
A schema uses an enum with a non-string type.
Error message: {context} uses enum type {kind}; only string enums are supported
NonArrayEnum
A schema declares an enum that is not an array.
Error message: {context} has a non-array enum
EmptyEnum
A schema declares an enum with no values.
Error message: {context} has an empty enum
NonStringEnumValue
A schema enum contains a non-string value.
Error message: {context} contains a non-string enum value; only string enums are supported
ConstNotInEnum
A schema declares a const value that is not one of its enum values.
Error message: {context} declares a constvalue that is not in itsenum``
InvalidSatayEnumVariants
An x-satay.enum-variants value is not an object.
Error message: {context}.x-satay.enum-variants must be an object
UnknownSatayEnumVariantValue
An x-satay.enum-variants entry points at a value that is not in the enum.
Error message: {context}.x-satay.enum-variants contains {wire_name}, which is not declared in the enum
InvalidSatayEnumVariantName
An x-satay.enum-variants entry has a non-string Rust variant name.
Error message: {context}.x-satay.enum-variants[{wire_name:?}] must be a string
ReservedSatayEnumVariantName
An x-satay.enum-variants entry uses a name reserved for generated fallback variants.
Error message: {context}.x-satay.enum-variants[{wire_name:?}] uses reserved fallback variant {rust_name}``
DuplicateSatayEnumVariantName
Two x-satay.enum-variants entries produce the same Rust variant name.
Error message: {context}.x-satay.enum-variants maps multiple values to {rust_name}``
NonArrayRequired
A schema has a required field that is not an array.
Error message: {context} has a non-array required field
NonStringRequiredField
A schema required array contains a non-string element.
Error message: {context} has a non-string required field name
UnsupportedIntegerFormat
An integer schema uses an unsupported format.
Error message: {context} uses unsupported integer format {format}``
UnsupportedNumberFormat
A number schema uses an unsupported format.
Error message: {context} uses unsupported number format {format}``
UnsupportedSatayParseAs
An x-satay.parse-as value is not a supported target type.
Error message: {context} uses unsupported x-satay.parse-as {parse_as}``
InvalidSatayParseAs
An x-satay.parse-as value is not a string.
Error message: {context}.x-satay.parse-as must be a string
SatayParseAsRequiresString
x-satay.parse-as was applied to an unsupported wire schema.
Error message: {context} uses x-satay.parse-as {parse_as}on{kind}; supported parse-as wire schemas are string schemas, plus integer schemas for bool
UnsupportedSatayIntegerType
An x-satay.integer-type value is not a supported Rust integer type.
Error message: {context} uses unsupported x-satay.integer-type {integer_type}``
InvalidSatayIntegerType
An x-satay.integer-type value is not a string.
Error message: {context}.x-satay.integer-type must be a string
SatayIntegerTypeRequiresInteger
x-satay.integer-type was applied to a non-integer schema.
Error message: {context} uses x-satay.integer-type {integer_type}on{kind}; supported integer-type wire schemas are integer schemas and string schemas with x-satay.parse-as integer-range
MissingArrayItems
An array schema is missing the required items field.
Error message: {context} array schema must declare items``
InlineObjectSchema
A schema defines an inline object instead of using a $ref.
Error message: {context} is an inline object schema; move it to components/schemas and use $ref``
UnsupportedMapObjectSchema
An object schema has no properties (i.e. acts as a map/dictionary), which is unsupported.
Error message: {context} is an object with neither propertiesnor a supportedadditionalProperties schema
UnsupportedSchemaType
A schema uses an unsupported type.
Error message: {context} uses unsupported schema type {kind}``
MissingSchemaType
A schema is missing a required type, $ref, or enum declaration.
Error message: {context} must declare type, $ref, or enum``
UnsupportedBooleanSchema
A JSON Schema boolean schema was used; Satay has no IR equivalent yet.
Error message: {context} is a boolean schema; boolean JSON Schemas are not supported yet
MultipleNonNullSchemaTypesUnsupported
A schema type array contains more than one non-null type.
Error message: {context} declares multiple non-null schema types; Satay supports at most one plus null
UnsupportedComposition
A schema uses a composition keyword (allOf, anyOf, oneOf) in an unsupported context.
Error message: {context} uses {keyword}, which is not supported in this context
UnsupportedAllOfSiblingKeyword
An allOf schema combines supported struct flattening with another schema keyword.
Error message: {context} uses allOfwith{keyword}; only object branch flattening is supported
UnsupportedAllOfBranch
An allOf branch cannot be flattened into a generated Rust struct.
Error message: {context}.allOf[{index}] must be a local component schema reference or object schema with properties
DuplicateAllOfProperty
Two allOf branches declare the same object property.
Error message: {context} declares duplicate allOfproperty{property}``
RecursiveAllOf
allOf component schemas form a recursive flattening cycle.
Error message: {context} forms a recursive allOfcycle through schema{schema}``
RecursiveDiscriminatorBranch
A discriminator union branch component recursively contains its own union.
Error message: {context} forms a recursive discriminator cycle through branch schema {schema}``
UnsupportedAnyOfSiblingKeyword
An anyOf schema combines a supported union with another schema keyword.
Error message: {context} uses anyOfwith{keyword}; only annotation siblings are supported
UnsupportedAnyOfBranch
An anyOf branch is not a supported union branch.
Error message: {context}.anyOf[{index}] must be a local component schema reference, inline string enum, inline primitive schema, or null schema
UnsupportedOneOfSiblingKeyword
A oneOf schema combines a supported union with another schema keyword.
Error message: {context} uses oneOfwith{keyword}; only annotation siblings are supported
UnsupportedOneOfBranch
A oneOf branch is not a supported union branch.
Error message: {context}.oneOf[{index}] must be a local component schema reference, inline string enum, inline primitive schema, or null schema
DuplicateUnionNullBranch
A plain anyOf or oneOf union has more than one null branch.
Error message: {context}.{keyword}[{index}] duplicates the union null branch
DuplicateOpenStringEnumValue
An open string enum anyOf repeats an enum or const value across branches.
Error message: {context} declares duplicate open string enum value {value}acrossanyOf branches
NullableUnionWithoutVariants
A nullable plain anyOf or oneOf union has no non-null branches.
Error message: {context}.{keyword} must declare at least one non-null branch
ShadowedUnionBranch
A plain anyOf or oneOf union has a branch that is statically shadowed by an earlier branch.
Error message: {context}.{keyword}[{index}] is shadowed by earlier branch {shadowed_by} under ordered serde untagged deserialization
EmptyAnyOf
A composition schema declares no branches.
Raised for empty anyOf and, today, for empty component allOf that is routed
through the shared empty composition-shape check.
Error message: {context} must declare at least one anyOf branch
RecursiveAnyOf
anyOf component schemas form a recursive union cycle.
Error message: {context} forms a recursive anyOfcycle through schema{schema}``
InvalidDiscriminatorUnion
A discriminator union does not use exactly one non-empty anyOf or oneOf branch list.
Error message: {context} discriminator unions must declare exactly one non-empty anyOforoneOf branch list
UnsupportedDiscriminatorBranch
A discriminator union branch is not a local component schema reference.
Error message: {context}.{keyword}[{index}] must be a local component schema reference when using discriminator``
DiscriminatorBranchNotObject
A discriminator union branch target does not generate as an object struct.
Error message: {context} discriminator branch {schema} must be an object struct component
DiscriminatorPropertyConflict
A discriminator branch object contains the discriminator property.
Error message: {context} discriminator branch {schema}contains discriminator property{property}``
InvalidDiscriminatorProperty
A discriminator branch object contains an invalid embedded discriminator property.
Error message: {context} discriminator branch {schema}property{property} must be {expected}
InvalidDiscriminatorMapping
A discriminator mapping entry targets a non-local schema or a schema outside the union branches.
Error message: {context}.discriminator.mapping[{value:?}] targets {target}, which is not a local union branch schema
DuplicateDiscriminatorMapping
Multiple discriminator mapping values target the same union branch schema.
Error message: {context}.discriminator.mapping maps multiple values to branch schema {schema}``
DiscriminatorMappingValueMismatch
A discriminator mapping value disagrees with a branch’s embedded discriminator property value.
Error message: {context}.discriminator.mapping maps value {value}to branch schema{schema}, but the branch declares discriminator value {actual}`
DuplicateDiscriminatorValue
Multiple discriminator branches resolve to the same discriminator value after implicit defaults are applied.
Error message: {context}.discriminator resolves multiple branch schemas to value {value}``
InvalidStringLengthBounds
A string schema specifies a minLength greater than its maxLength.
Error message: {context} has minLength {min_length} greater than maxLength {max_length}
UniqueItemsUnsupported
A schema uses uniqueItems, which cannot be enforced by generated Vec-backed types.
Error message: {context} uses uniqueItems; generated Vec-backed types cannot enforce uniqueness yet
InvalidArrayLengthBounds
An array schema specifies minItems greater than maxItems.
Error message: {context} has minItems {min_items} greater than maxItems {max_items}
UnsupportedKeyword
A schema uses a keyword that is not safely supported.
Error message: {context} uses {keyword}, which is not safely supported yet
InvalidNonNegativeIntegerKeyword
A schema keyword that must be a non-negative integer has an invalid value.
Error message: {context}.{keyword} must be a non-negative integer
InvalidBooleanKeyword
A schema keyword that must be a boolean has an invalid value.
Error message: {context}.{keyword} must be a boolean
ExclusiveLimitRequiresBound
An exclusiveMinimum/exclusiveMaximum keyword is present but the corresponding bound is missing.
Error message: {context}.{exclusive_keyword} requires {keyword}``
InvalidFiniteNumberKeyword
A schema keyword that must be a finite number has a non-finite value.
Error message: {context}.{keyword} must be a finite number
ExpectedInteger
A value expected to be an integer is not.
Error message: {context} must be an integer
EmptyIntegerBounds
Integer bounds (minimum/maximum) do not permit any value.
Error message: {context} integer bounds do not allow any value
ExclusiveIntegerMinimumOverflow
An exclusive integer minimum overflows i64.
Error message: exclusive integer minimum overflows
ExclusiveIntegerMaximumOverflow
An exclusive integer maximum overflows i64.
Error message: exclusive integer maximum overflows
EmptyNumberBounds
Number bounds (minimum/maximum) do not permit any value.
Error message: {context} number bounds do not allow any value
MissingOperationResponses
An operation does not declare any responses.
Error message: operation {operation_id} must declare responses
ExpectedArray
A value expected to be an array is not.
Error message: {context} must be an array
UnsupportedParameterLocation
A parameter uses an unsupported location (e.g. cookie) instead of path, query, or header.
Error message: {context} parameter {wire_name}is in{location}; only path, query, and header parameters are supported
ContentParameterUnsupported
A parameter uses content instead of schema.
Error message: {context} parameter {wire_name}usescontent; schema parameters are required
MissingParameterSchema
A parameter is missing a required schema declaration.
Error message: {context} parameter {wire_name} must declare schema
NullableParameterUnsupported
A parameter is nullable, which is not supported.
Error message: parameter {wire_name} is nullable; nullable parameters are not supported
AnyOfParameterUnsupported
A parameter uses anyOf, which is not supported for URI/header encoding yet.
Error message: parameter {wire_name}usesanyOf; anyOf parameters are not supported yet
MapParameterUnsupported
A parameter is a map or arbitrary JSON value, which has no URI/header encoding.
Error message: parameter {wire_name} is a map or JSON value; map parameters are not supported
ArrayPathParameterUnsupported
A path parameter is an array, which is not supported.
Error message: path parameter {wire_name} is an array; array path parameter styles are not supported
ArrayHeaderParameterUnsupported
A header parameter is an array, which is not supported.
Error message: header parameter {wire_name} is an array; array header parameter styles are not supported
PathParameterNotRequired
A path parameter does not set required: true.
Error message: path parameter {wire_name} must set required: true
MissingContent
A context is missing a required content declaration.
Error message: {context} must declare content
MissingJsonContent
A context is missing the required application/json content type.
Error message: {context} must declare application/json content
MissingJsonSchema
A context’s application/json content is missing a schema.
Error message: {context} application/json content must declare schema
DefaultResponseBodyUnsupported
A response body uses the default status, which is not yet supported for decoding.
Error message: {context} contains a default response body; default response decoding is not supported yet
InvalidStatusCode
A response contains an invalid HTTP status code string.
Error message: {context} contains invalid status code {status}``
OutOfRangeStatusCode
A response contains a status code outside the valid 100–599 range.
Error message: {context} contains out-of-range status code {status_code}``
MissingResponseJsonContent
A response for a given status code is missing application/json content.
Error message: {context} {status} response must declare application/json content
UnclosedPathParameter
A path template contains a parameter that is never closed.
Error message: path {path} contains an unclosed parameter
EmptyPathParameter
A path template contains an empty parameter (e.g. {}).
Error message: path {path} contains an empty parameter
UndeclaredPathParameter
A path template references a parameter that is not declared in the operation’s parameters.
Error message: path {path}uses parameter{name} but it is not declared
UnusedPathParameter
A parameter is declared for a path but never used in the path template.
Error message: path parameter {name}is declared but not used in path{path}``
ResolveReference
A $ref could not be resolved because the referenced component failed validation.
Error message: failed to resolve reference {reference} in {context}: {source}
NonLocalReference
A reference points to an external document; only local (#) references are supported.
Error message: only local references are supported
InvalidLocalReference
A local reference is not a valid JSON pointer.
Error message: local reference must be a JSON pointer
MissingJsonPointerToken
A JSON pointer is missing a required token segment.
Error message: missing {token}``
InvalidComponentReference
A $ref does not point to the expected #/components/{section}/… path.
Error message: reference {reference} must point to #/components/{section}/...
CircularReference
A local $ref chain references itself.
Error message: circular reference {reference}``
ExpectedObject
A value expected to be an object is not.
Error message: {context} must be an object
ExpectedObjectField
A nested field expected to be an object is not.
Error message: {context}.{field} must be an object
Trait Implementations§
Source§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()