Skip to content

Documentation / @sw-file-lib/xml / xml-schema / SchemaIssueMap

Interface: SchemaIssueMap ​

ts
interface SchemaIssueMap {
  invalid_type: { expected: ExpectedSchemaInputType; value: SchemaInput };
  invalid_value: { expected: "boolean_string" | "numeric_string"; value: string };
  missing_required_field: { expected: ExpectedSchemaInputType };
  invalid_union: { unionErrors: readonly SchemaError[]; input: SchemaInput | { element: SwXmlNode; key: string } };
  duplicate_elements: {};
  unknown_attribute: { key: string; value: string };
  unknown_child: { child: SwXmlNode };
}

Defined in: packages/xml/src/xml-schema/errors.ts:23

Properties ​

PropertyTypeDescription

invalid_type

{ expected: ExpectedSchemaInputType; value: SchemaInput; }

‐

invalid_type.expected

ExpectedSchemaInputType

The expected value type.

invalid_type.value

SchemaInput

The original value that caused the issue.

invalid_value

{ expected: "boolean_string" | "numeric_string"; value: string; }

‐

invalid_value.expected

"boolean_string" | "numeric_string"

The expected value.

invalid_value.value

string

The original value that caused the issue.

missing_required_field

{ expected: ExpectedSchemaInputType; }

‐

missing_required_field.expected

ExpectedSchemaInputType

The expected value type.

invalid_union

{ unionErrors: readonly SchemaError[]; input: | SchemaInput | { element: SwXmlNode; key: string; }; }

‐

invalid_union.unionErrors

readonly SchemaError[]

Errors returned by each union branch.

invalid_union.input

| SchemaInput | { element: SwXmlNode; key: string; }

The input that failed to match any union branch.

When parsing a field, this is the parent element and field key because the union could have matched either an attribute or a child element.

duplicate_elements

{ }

‐

unknown_attribute

{ key: string; value: string; }

‐

unknown_attribute.key

string

The unknown attribute name.

unknown_attribute.value

string

The raw attribute value.

unknown_child

{ child: SwXmlNode; }

‐

unknown_child.child

SwXmlNode

The unknown child element.