Commit cc42817
fix(core): don't inline-interpolate into a fuzzy-match marker
A match RHS like `'#[] ##(itemSchema)'` reached processInlineEmbedded
because it contains `#(`. The inline pass evaluated the embedded schema
to a Map and stringified it back into the marker, corrupting it — the
match engine then threw `expected: [R_CURLY]`.
v1 never inline-interpolated (only whole-value `#(...)` / `##(...)`
strings were processed), so a `#`-leading marker survived verbatim to
the match engine, where the `#[]` each-schema path resolved the bare /
embedded reference. Mirror that: processEmbeddedString now leaves any
`#`-leading string intact and defers `#(...)` / `##(...)` resolution to
the match engine.
The documented shortcut is the bare reference `'#[] schema'`; `'#[]
#(schema)'` is a redundant synonym. The fix simply stops the
undocumented embedded variants from parse-erroring. Adds tests pinning
the canonical form, the synonym equivalence, and the whole-array vs
per-element nullability distinctions.
fixes #2893
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0b594f0 commit cc42817
2 files changed
Lines changed: 91 additions & 0 deletions
File tree
- karate-core/src
- main/java/io/karatelabs/core
- test/java/io/karatelabs/core
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3072 | 3072 | | |
3073 | 3073 | | |
3074 | 3074 | | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
3075 | 3085 | | |
3076 | 3086 | | |
3077 | 3087 | | |
| |||
Lines changed: 81 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
732 | 732 | | |
733 | 733 | | |
734 | 734 | | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
735 | 816 | | |
0 commit comments