nori/validator/errors

Validation error types for OpenAPI documents.

Types

Validation errors that can occur when validating an OpenAPI document.

pub type ValidationError {
  EmptyRequiredField(path: String)
  InvalidPath(path: String, reason: String)
  InvalidParameter(path: String, reason: String)
  InvalidComponentName(
    path: String,
    name: String,
    reason: String,
  )
  UnresolvableReference(ref: String)
  MissingResponse(path: String, message: String)
  DuplicateOperationId(operation_id: String)
  UndefinedSecurityScheme(name: String)
  InvalidServerUrl(url: String, reason: String)
  SchemaError(path: String, message: String)
  GenericError(message: String)
}

Constructors

  • EmptyRequiredField(path: String)

    A required field is empty

  • InvalidPath(path: String, reason: String)

    Path format is invalid

  • InvalidParameter(path: String, reason: String)

    Parameter validation failed

  • InvalidComponentName(path: String, name: String, reason: String)

    Component name is invalid

  • UnresolvableReference(ref: String)

    A $ref reference cannot be resolved

  • MissingResponse(path: String, message: String)

    Operation is missing required response

  • DuplicateOperationId(operation_id: String)

    Duplicate operation ID

  • UndefinedSecurityScheme(name: String)

    Security scheme referenced but not defined

  • InvalidServerUrl(url: String, reason: String)

    Invalid server URL

  • SchemaError(path: String, message: String)

    Schema validation error

  • GenericError(message: String)

    Generic validation error

Values

pub fn get_path(error: ValidationError) -> Result(String, Nil)

Returns the path where the error occurred, if available.

pub fn to_string(error: ValidationError) -> String

Converts a validation error to a human-readable string.

Search Document