diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 5815f0e..3312d27 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -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. diff --git a/jsonpatchx/backend.py b/jsonpatchx/backend.py index 65d498b..aa3316f 100644 --- a/jsonpatchx/backend.py +++ b/jsonpatchx/backend.py @@ -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] @@ -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]