#[non_exhaustive]pub enum ValidationError {
Show 72 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,
},
InvalidSatayEnumVariants {
context: String,
},
UnknownSatayEnumVariantValue {
context: String,
wire_name: String,
},
InvalidSatayEnumVariantName {
context: String,
wire_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,
},
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,
},
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
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
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 without properties; map/object schemas are not supported yet
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) that is outside MVP scope.
Error message: {context} uses {keyword}, which is not in the MVP scope
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
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()