Skip to content

Fix slash escaping in entity keys and navigation paths - #320

Open
Shubham-Padkonde wants to merge 1 commit into
SAP:masterfrom
Shubham-Padkonde:fix/escape-key-path-slashes
Open

Shubham-Padkonde wants to merge 1 commit into
SAP:masterfrom
Shubham-Padkonde:fix/escape-key-path-slashes

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

An entity key such as /BAZ/FOO currently leaves its slashes unescaped, which can make the server interpret part of the key as a path. Encode slashes inside OData quoted literals while retaining separators outside them. This also handles doubled apostrophes and preserves the encode_path=False opt-out.

Fixes #282. The earlier attempt in #284 identified navigation as a limitation; the literal-aware encoding here covers both collection and single-entity navigation without encoding their separators. Tests also cover changeset/batch serialization and decoding, percent signs, and GET/update/delete paths.

Validation: all 312 tests pass (pytest --cov-report term --cov=pyodata), Pylint scores 10/10, pinned Flake8 passes, and git diff --check passes. Seven initial regression cases failed before the fix.

Fixes SAP#282 while retaining navigation separators and the encoding opt-out.
@cla-assistant

cla-assistant Bot commented Oct 2, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@phanak-sap

Copy link
Copy Markdown
Contributor

The PR is fixing only outbound part, ignoring necessary changes for inbound direction.

Check #309 and #313.

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.

Incorrect escaping of path

2 participants