pain001-lsp v0.0.54 is a Language Server Protocol implementation for payment-data authoring. It validates payment JSON against ISO 20022 message schemas as you type — in VS Code, Neovim, Helix, Emacs, or any LSP-compliant editor.
A malformed batch discovered at the bank gateway costs a repair cycle, a cut-off time, and sometimes a settlement day. The same error discovered as a red squiggle while typing costs nothing. That is the entire premise.
01. Six editor features#
- Live diagnostics. Each record in a payment JSON file is validated against the selected message type's JSON Schema on open and on every change. Dedicated checks cover IBAN checksums (ISO 13616 mod-97) and BIC structure (ISO 9362) across debtor, creditor, charge, and forwarding-agent fields.
- Completion. Field-name and message-type suggestions with inline documentation.
- Hover. Schema descriptions for the field under the cursor — lengths, formats, requirements.
- Quick-fix code action. "Add missing required fields" inserts type-correct placeholders, multi-record aware.
- Formatting. Re-serialises payment JSON with 2-space indentation and a trailing newline; malformed JSON is left untouched rather than mangled.
- Document symbols. One symbol per payment record, so editor outlines and breadcrumbs navigate large batches.
CSV files are supported for diagnostics: .csv URIs are routed through a dedicated CSV validation path.
The default message type is pain.001.001.09; all 11 supported definitions (pain.001.001.03–.12, pain.008.001.02) can be selected per workspace via initializationOptions or live via workspace/didChangeConfiguration.
02. Setup#
pip install pain001-lsp
Neovim (0.11+):
vim.lsp.config("pain001", {
cmd = { "pain001-lsp" },
filetypes = { "json" },
init_options = { messageType = "pain.001.001.09" },
})
vim.lsp.enable("pain001")
VS Code: a launchable extension scaffold ships in the repository's editors/vscode/ directory. Helix, Emacs (eglot), and generic clients: point the language server command at pain001-lsp (stdio).
03. Built on pygls, verified to 100%#
The server is a single auditable module built on pygls, the same foundation used by major Python language servers. Diagnostics carry source: "pain001-lsp" so they compose cleanly with other servers, and the test suite is enforced at 100% line and branch coverage in CI.
FAQ#
Why validate payment files in an editor at all?
Because most corporate payment batches still begin life as a file a human assembles or reviews. Editor-time validation moves rejection-class errors — a transposed IBAN digit, a missing requested_execution_date — from the bank's gateway to the keystroke where they happen.
Does it validate the final XML?
The LSP validates the input records. XSD validation of the rendered XML happens in the core library at generation time — the same dual gate the CLI and REST API apply.
Which file types does it understand?
JSON arrays of flat payment records (the primary target, with all six features) and CSV files (diagnostics). See the repository for editor-specific guides.