Repository navigation
adopt rift#1566: LookupSpec delimiter can be a multi-character string - #351
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #338
Why
rift 0.24.0 (rift#1566) accepts a multi-character
csv.delimiter("||"), as Mountebank does.LookupSpec.fromCsvonly took achar.What
LookupSpec.fromCsv(String path, String keyColumn, String delimiter). The value is sent verbatim.charoverload is kept (source and binary compatible) and delegates to it, so its wire output is byte-identical to before.null→ NPE;""→ IAE (the engine reads it as,, whichfromCsv(path, keyColumn)already means);?).Optional<Character>field becomesOptional<String>(private).docs/design/sdk-api.mdin the lookup grammar block.Tests
LookupSpecWireTest: +6 tests (14 total):"||"gives the literal wire JSON;";"and';'produce identical output;LookupGrammarIT: a new live case reads a||-delimited CSV and serves the looked-up row.verifyon engine v0.24.0 passed on SPAWN and EMBEDDED.🤖 Generated with Claude Code