Class: Lutaml::Xml::Error::SchemaValidationError

Inherits:
XmlError show all
Defined in:
lib/lutaml/xml/error/schema_validation_error.rb

Overview

Collected when a model's generated XML does not conform to the XSD schema configured via the validate_xml_with macro.

One instance represents one schema violation reported by the validating parser, so Lutaml::Model::ValidationError#error_messages lists each violation individually.

Not to be confused with Schema::Xsd::SchemaValidationError, which reports problems in an XSD document itself.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, schema_path) ⇒ SchemaValidationError

Returns a new instance of SchemaValidationError.



18
19
20
21
# File 'lib/lutaml/xml/error/schema_validation_error.rb', line 18

def initialize(message, schema_path)
  @schema_path = schema_path
  super("XML does not conform to schema #{schema_path}: #{message}")
end

Instance Attribute Details

#schema_pathObject (readonly)

Returns the value of attribute schema_path.



16
17
18
# File 'lib/lutaml/xml/error/schema_validation_error.rb', line 16

def schema_path
  @schema_path
end