Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ writes:

- [`scorecard.yml`](scorecard.yml)
- [`dependabot-update-openapi-snapshots.yml`](dependabot-update-openapi-snapshots.yml)
(mints app token before regenerating and committing snapshots)

This keeps write operations explicit and reduces default token blast radius.

Expand Down
16 changes: 1 addition & 15 deletions jsonpatchx/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ def parts(self) -> Sequence[str]:


class _DEFAULT_POINTER_CLS(JsonPointer): # type: ignore[misc]
# fixes https://github.com/stefankoegl/python-json-pointer/issues/63
# and https://github.com/stefankoegl/python-json-pointer/issues/70
# fixes https://github.com/stefankoegl/python-json-pointer/issues/70
@override
@classmethod
def get_part(cls, doc, part): # type: ignore[no-untyped-def]
Expand All @@ -100,21 +99,8 @@ def get_part(cls, doc, part): # type: ignore[no-untyped-def]
f"Cannot apply token {part!r} to non-container type {type(doc)}"
)
key = super().get_part(doc, part)
if isinstance(key, int) and not _NONNEGATIVE_ARRAY_INDEX_PATTERN.fullmatch(
str(part)
):
raise JPException("'%s' is not a valid sequence index" % part)
return key

@override
def to_last(self, doc): # type: ignore[no-untyped-def] # pragma: no cover
doc, key = super().to_last(doc)
if isinstance(key, int) and not _NONNEGATIVE_ARRAY_INDEX_PATTERN.fullmatch(
str(self.parts[-1])
):
raise JPException("'%s' is not a valid sequence index" % self.parts[-1])
return doc, key

@override
def walk(self, doc, part): # type: ignore[no-untyped-def]
part = self.get_part(doc, part) # type: ignore[no-untyped-call]
Expand Down
Loading