Summary
src/synthorg/api/openapi.py defines _ERROR_RESPONSES as a tuple of 7-element tuples, which requires a noqa: PLR0913 suppression on _build_reusable_response (6 keyword-only parameters) and positional destructuring in the calling loop.
Proposed Change
Replace the tuple-of-tuples with a TypedDict (or NamedTuple):
class _ErrorResponseSpec(TypedDict):
status: int
key: str
description: str
error_code: ErrorCode
error_category: ErrorCategory
detail: str
retryable: bool
Then _build_reusable_response accepts a single _ErrorResponseSpec parameter, eliminating the PLR0913 noqa and making the data structure harder to misorder.
Context
Found during pre-PR review of #506. Deferred as low-priority style improvement (scope:small, non-blocking).
Acceptance Criteria
Summary
src/synthorg/api/openapi.pydefines_ERROR_RESPONSESas a tuple of 7-element tuples, which requires anoqa: PLR0913suppression on_build_reusable_response(6 keyword-only parameters) and positional destructuring in the calling loop.Proposed Change
Replace the tuple-of-tuples with a
TypedDict(orNamedTuple):Then
_build_reusable_responseaccepts a single_ErrorResponseSpecparameter, eliminating thePLR0913noqa and making the data structure harder to misorder.Context
Found during pre-PR review of #506. Deferred as low-priority style improvement (scope:small, non-blocking).
Acceptance Criteria
_ERROR_RESPONSESuses a named type instead of bare tuplesnoqa: PLR0913removed from_build_reusable_response