Skip to content

adopt rift#1566: LookupSpec delimiter can be a multi-character string - #351

Merged
EtaCassiopeia merged 1 commit into
masterfrom
feat/rift-338-lookup-string-delimiter
Oct 28, 2026
Merged

EtaCassiopeia merged 1 commit into
masterfrom
feat/rift-338-lookup-string-delimiter

Conversation

@EtaCassiopeia

Copy link
Copy Markdown
Collaborator

Closes #338

Why

rift 0.24.0 (rift#1566) accepts a multi-character csv.delimiter ("||"), as Mountebank does. LookupSpec.fromCsv only took a char.

What

  • New LookupSpec.fromCsv(String path, String keyColumn, String delimiter). The value is sent verbatim.
  • The char overload is kept (source and binary compatible) and delegates to it, so its wire output is byte-identical to before.
  • Refused up front:
    • null → NPE;
    • "" → IAE (the engine reads it as ,, which fromCsv(path, keyColumn) already means);
    • an unpaired surrogate anywhere in the string → IAE (it would reach the engine as ?).
    • A properly paired supplementary character is accepted.
  • The Optional<Character> field becomes Optional<String> (private).
  • Docs: javadoc, and docs/design/sdk-api.md in the lookup grammar block.

Tests

  • LookupSpecWireTest: +6 tests (14 total):
    • "||" gives the literal wire JSON;
    • ";" and ';' produce identical output;
    • empty and null are refused;
    • an unpaired surrogate is refused;
    • an emoji is accepted.
  • LookupGrammarIT: a new live case reads a ||-delimited CSV and serves the looked-up row.
  • Local runs: full verify on engine v0.24.0 passed on SPAWN and EMBEDDED.

🤖 Generated with Claude Code

…4.0 does

rift#1566 made csv.delimiter any string (Mountebank accepts "||"), but
LookupSpec.fromCsv only took a char. Add a String overload; the char form
delegates to it. An empty string is refused (the engine reads it as ',',
which the two-argument form already says), and so is an unpaired
surrogate, which would reach the engine as '?'.

Closes #338
@EtaCassiopeia
EtaCassiopeia merged commit 3b14af1 into master Oct 28, 2026
18 checks passed
@EtaCassiopeia
EtaCassiopeia deleted the feat/rift-338-lookup-string-delimiter branch October 28, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adopt rift#1566: LookupSpec delimiter can be a multi-character string

1 participant