What's happening
actionkit/petitions.py:57-58:
def get(self, id):
return super().get(f"petitionpage/{id}/")
overrides the base class's:
def get(self, resource_uri=None, *args, **params):
The override is not compatible with the base contract:
- No query-param (
**params) support.
- Hardcodes
"petitionpage/{id}/" rather than using self.resource_name (currently the same value, "petitionpage", but that's coincidental, not delegated).
- Calling it the way the base class documents its contract —
Petitions.get(resource_uri=...) — raises TypeError, since the override has no resource_uri parameter.
This is a Liskov-substitution break: code written generically against HttpMethods.get's signature cannot safely call Petitions.get.
Suggested fix direction
Rename to something like get_by_id(id) (there's already a HttpMethods.get_by_id convention used elsewhere) instead of overriding get, or bring the signature in line with the base class (get(self, resource_uri=None, *args, **params)) and derive the id-based path from resource_uri when it looks like a bare id.
Test coverage
Pinned by tests/test_petitions.py::test_get_by_id_hardcodes_petitionpage_path and tests/test_petitions.py::test_get_with_resource_uri_kwarg_breaks_the_override (the latter documents the break, not a fix).
What's happening
actionkit/petitions.py:57-58:overrides the base class's:
The override is not compatible with the base contract:
**params) support."petitionpage/{id}/"rather than usingself.resource_name(currently the same value,"petitionpage", but that's coincidental, not delegated).Petitions.get(resource_uri=...)— raisesTypeError, since the override has noresource_uriparameter.This is a Liskov-substitution break: code written generically against
HttpMethods.get's signature cannot safely callPetitions.get.Suggested fix direction
Rename to something like
get_by_id(id)(there's already aHttpMethods.get_by_idconvention used elsewhere) instead of overridingget, or bring the signature in line with the base class (get(self, resource_uri=None, *args, **params)) and derive the id-based path fromresource_uriwhen it looks like a bare id.Test coverage
Pinned by
tests/test_petitions.py::test_get_by_id_hardcodes_petitionpage_pathandtests/test_petitions.py::test_get_with_resource_uri_kwarg_breaks_the_override(the latter documents the break, not a fix).