Skip to content

fix: support escaped dots and backslashes in required field paths - #46

Merged
AdityaWagh06 merged 1 commit into
OpenWave-India:mainfrom
Mrun25:fix/escaped-required-field-paths
Nov 7, 2026
Merged

AdityaWagh06 merged 1 commit into
OpenWave-India:mainfrom
Mrun25:fix/escaped-required-field-paths

Conversation

@Mrun25

@Mrun25 Mrun25 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

What this changes

Closes #31

Split required-field paths without treating escaped dots as separators. \. addresses a literal dot and \\ addresses a literal backslash; other backslashes, including a trailing one, remain literal. Both required and values use this lookup, list indexes keep working, and failure reasons keep the original path spelling.

Document the escape syntax and YAML/JSON quoting in README and docs/file-formats.md. No new dependencies.

How it was tested

  • Full suite: 194 tests pass on Linux with Python 3.11, 3.12 and 3.13. Python 3.11 ran without the memory extra; Python 3.12 and 3.13 ran with it.
  • Added eight regression/control cases for dotted keys, escaped backslashes, trailing and unknown escapes, list indexes, empty path segments, and original failure spelling. Three cases fail on unchanged main and pass with the fix.
  • ruff check src tests examples and ruff format --check src tests examples pass.
  • Offline quickstart: validate, baseline run and candidate run complete; compare returns the expected exit code 1 for the fixture's known regressions.
  • Windows and macOS CI have not run for this candidate.

Checklist

  • pytest passes locally
  • ruff check and ruff format --check pass
  • New behavior has tests that assert on outcomes, and bug fixes include a test that fails without the fix
  • README or docs updated if CLI flags, file formats, or check behavior changed
  • Tests run offline (no network, no model downloads)

@Mrun25
Mrun25 requested a review from AdityaWagh06 as a code owner November 5, 2026 11:47
@AdityaWagh06
AdityaWagh06 merged commit 0537780 into OpenWave-India:main Nov 7, 2026
13 checks passed
@AdityaWagh06

Copy link
Copy Markdown
Member

Thanks @Mrun25, clean fix with great tests, merged! 🎉 That's your 4th merged PR in ModelDiff.

If you like the project, a ⭐ on the repo helps a lot. Follow OpenWave India for new issues and releases:

@Mrun25

Mrun25 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review and kind words! Glad I could contribute 😊

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.

Support JSON keys that contain dots in required_fields paths

2 participants