pub enum IssueKind {
Show 18 variants
MissingRequiredField {
field_name: String,
},
GroupNotAllowed {
group: String,
},
SegmentNotAllowed {
segment: String,
},
FieldConditionNotSatisfied {
field_name: String,
failed: Vec<u32>,
},
ConditionUnknown {
field_name: String,
unresolved: UnresolvedConditions,
},
PackageCardinality {
package_id: String,
present: usize,
min: usize,
max: usize,
codes: Vec<String>,
},
RepeatedInTransaction {
path: String,
count: usize,
},
RepetitionCount {
path: String,
count: usize,
},
CodeNotAllowedForPid {
value: String,
allowed: Vec<String>,
},
AnswerNotInList {
answer: String,
list: String,
allowed: Vec<String>,
},
ValueTooLong {
field_name: String,
length: usize,
max: usize,
},
ValueNotNumeric {
field_name: String,
},
IntervalNotPositive {
begin: String,
end: String,
},
ReferenceNotFound {
reference: String,
value: String,
targets: Vec<String>,
},
UntSegmentCountMismatch {
declared: usize,
actual: usize,
},
UntCountNotVerifiable {
unh_count: usize,
},
Bo4eFieldDropped {
path: String,
},
StructureDiagnostic {
kind: StructureDiagnosticKind,
segment_id: String,
position: usize,
detail: String,
},
}Expand description
What kind of problem a ValidationIssue reports.
One variant per problem the validator actually emits. ErrorCodes lists 22
code strings, but only these are ever constructed; adding a new check means
adding a variant, which the compiler then forces every narrator to handle.
Variants§
MissingRequiredField
AHB001 — a field the AHB marks mandatory for this PID is absent.
GroupNotAllowed
AHB002 — a segment group is present although its AHB condition does not
hold (Muss [96] without STS+7 ZAP). group is its path (SG4/SG5).
SegmentNotAllowed
AHB002 — a segment is present although its own AHB condition does not
hold (CAV+Z56 Wärmenutzung, Muss [239], without CAV+Z65 in its
SG10). segment is its path (SG4/SG8/SG10/CAV).
FieldConditionNotSatisfied
AHB003 — the field is present but its AHB condition is not satisfied.
failed are the conditions that make it false (see
ConditionExprEvaluator::false_ids_with_ub): what kind of error it is
depends on them.
ConditionUnknown
AHB005 — the condition expression could not be fully evaluated.
PackageCardinality
AHB006 — number of codes present in a package is outside min..max.
RepeatedInTransaction
AHB007 — a group or segment the AHB allows once per transaction
([2061] “genau einmal je SG4 IDE (Vorgang)”) is sent count times in
one. path is the group or segment (SG4/SG8, SG4/STS).
RepetitionCount
AHB008 — a group or segment sent another number of times in its group
than a repetition condition allows there: too often (ORDERS [2005]
“Pro SG29 LIN ist die SG34 RFF+Z09 (Gerätenummer) genau einmal
anzugeben”) or too rarely (UTILMD [2317] “mindestens zweimal”).
path is the group or segment (SG29/SG34), count how often the
group instance holds it.
CodeNotAllowedForPid
COD002 — the value is a valid code but not allowed for this PID.
AnswerNotInList
COD003 — a response’s answer (AJT 4465, STS C556/9013) is not one of the
codes of the EBD or Codeliste it names beside it (AJT 1082, C556/1131):
AJT+ZB5+G_0059. The AHB lists which lists may be named; the EBD
document says what they hold.
ValueTooLong
FMT001 — the value is longer than its MIG format allows (an..512).
ValueNotNumeric
FMT002 — a data element of numeric format (n..10) holds something
that is not a number (O5D2DXBG1A).
IntervalNotPositive
CON001 — a period ends before it begins, or as it begins where it may
not be empty: DTM+164 not after the DTM+163 beside it (APERAK Z34
“Zeitintervall negativ oder Null”). begin and end are the two DTMs
(DTM+163); see crate::consistency.
ReferenceNotFound
CON002 — a reference within a transaction names nothing in it: an
SG8 RFF+Z19 (Messlokation) naming none of the transaction’s
LOC+Z17 (APERAK Z21 “Geschäftsvorfallinterne Referenzierung
fehlerhaft”). reference is the RFF (RFF+Z19), value the id it
names, targets what it may name (LOC+Z17); see
crate::consistency.
UntSegmentCountMismatch
STR007 — UNT’s declared segment count disagrees with the actual count.
UntCountNotVerifiable
STR007 — the input holds several messages, so the count is not checkable.
Bo4eFieldDropped
MAP001 — a field of the BO4E input that the EDIFACT rendered from it
does not carry: no mapping rule of the PID writes it (issue #446).
Only BO4E validation raises it; path is the field’s place in the
input (stammdaten.marktteilnehmer[0].ansprechpartner).
StructureDiagnostic
STR003 / STR008 — a structure diagnostic raised during assembly.
detail carries the diagnostic’s own message verbatim: some
diagnostics (e.g. mig_assembly::Assembler::assemble_with_diagnostics’s
"Assembly failed: {e}" case) say something not derivable from
(kind, segment_id, position) alone.