Class: Lutaml::Xml::Error::SchemaValidationError
- Inherits:
-
XmlError
- Object
- Model::Error
- XmlError
- Lutaml::Xml::Error::SchemaValidationError
- 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
-
#schema_path ⇒ Object
readonly
Returns the value of attribute schema_path.
Instance Method Summary collapse
-
#initialize(message, schema_path) ⇒ SchemaValidationError
constructor
A new instance of SchemaValidationError.
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(, schema_path) @schema_path = schema_path super("XML does not conform to schema #{schema_path}: #{}") end |
Instance Attribute Details
#schema_path ⇒ Object (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 |