AshCsvInterchange.Import.HeaderCheck (AshCsvInterchange v0.1.0)

Copy Markdown View Source

Validates a parsed CSV header row against the type's declared headers. Header names are compared after whitespace trim and ASCII case-fold.

Failures here are fatal because they apply to the whole file, not a single row.

Summary

Functions

Validates a header row against a headers keyword list of the form [required: [...], optional: [...]] where each entry is a bare string column name or a {column, input_key} tuple.

Functions

verify(header_row, headers_config)

@spec verify([String.t()], keyword()) ::
  {:ok, %{headers: [String.t()], warnings: [AshCsvInterchange.Error.t()]}}
  | {:error, AshCsvInterchange.Error.t()}

Validates a header row against a headers keyword list of the form [required: [...], optional: [...]] where each entry is a bare string column name or a {column, input_key} tuple.