Validation โ
Every call to parseScheduleDataSet runs the full spec validator against the parsed result. The validator implements the rules from IATA SSIM, Chapter 7, ยงยง 7.5.1โ7.5.5 (March 2012 edition) โ that is the authoritative reference this library is built against.
Newer editions
If you have access to a more recent edition of SSIM, please open an issue โ newer editions may add DEI codes or revise byte assignments and we want to fold those in. The library is validated against the March 2011 and March 2012 editions today; the only material delta between them is the Secure Flight Indicator at byte 169 of the Carrier record (effective 1 Oct 2012).
What gets checked โ
The validator covers field-level Status (M Mandatory / C Conditional / O Optional), value formats, and cross-record consistency. Highlights:
- ยง 7.5.1 Header โ canonical Title of Contents,
recordSerialNumber === 1. - ยง 7.5.2 Carrier โ Time Mode (
U/L), IATA airline code format, mandatory date parsing,validFrom โค validTo, Schedule Status (P/C), Secure Flight Indicator (S/X/blank, eff. 1 Oct 2012), Electronic Ticketing (EN/ET/blank). - ยง 7.5.3 Flight Leg โ IATA airline + 4-digit flight number, IVI / leg sequence 01โ99, period validity, at least one Day of Operation, 3-letter station codes, all four times parse, both UTC offsets, PRBD or Aircraft Configuration mandatory.
- ยง 7.5.4 Segment Data โ identification fields, single-alpha board/off-point indicators, 3-digit DEI, 3-letter board/off points.
- ยง 7.5.5 Trailer โ Continuation/End Code (
C/E),serialNumberCheckReference === recordSerialNumber โ 1. - Cross-record โ every Type 3/4/5 record's airline designator must match the opening Type 2 Carrier Record.
See SDS โ Error Handling for the complete rule catalogue.
Two modes โ
Lenient (default) โ
Issues are collected as ScheduleDataSetWarning entries on the returned object:
import { parseScheduleDataSet } from 'iata-ssim/sds'
const dataSet = parseScheduleDataSet(text)
for (const w of dataSet.warnings) {
console.warn(`${w.rule} โ line ${w.lineNumber}:${w.column}: ${w.message}`)
// [ยง 7.5.2 Time Mode] line 2:2: Time Mode must be "U" (UTC) or "L" (Local), got "A".
}Each warning carries the byte-precise location: lineNumber, column, endColumn. IDE / terminal integrations turn file:line:col into clickable links.
Strict โ
The first issue throws ScheduleDataSetParseError:
import { parseScheduleDataSet, ScheduleDataSetParseError } from 'iata-ssim/sds'
try {
parseScheduleDataSet(text, { strict: true })
}
catch (err) {
if (err instanceof ScheduleDataSetParseError) {
console.error(`${err.recordType}/${err.field} @ ${err.lineNumber}: ${err.message}`)
}
}Real-world tested โ
The library is validated against 14 real SSIM files from 10 different public sources, totalling โ 48 500 flight legs โ including a 36 468-leg American Airlines 2015 production schedule. Across all clean files there are zero false positives; every issue surfaced on non-clean files is a real spec deviation (mostly cross-record airline mismatches and missing-mandatory-field violations).
See samples-validator/ in the repository for the bulk validation script. Run pnpm samples:validate for a compact summary or pnpm samples:validate:verbose for ESLint-style per-issue output with caret markers.
Try it yourself โ
The Playground runs the parser and validator entirely in your browser โ drop a .ssim file or paste contents and inspect issues in the Warnings tab. Click any warning row to highlight the offending bytes in the source.