Repository navigation
refactor: simplify endpoint validation and apply review follow-ups - #221
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Bring the combined #221 and #222 changes onto main: validate requests in endpoint methods, preserve HTTP 200 on model parsing errors, adopt pytest-cov, and restore useful comments. Preserve newer main fixes and dependency updates while resolving integration conflicts and deduplicating an ETag regression test.
Endpoint validation repeats the public method signatures in a central rule table. Move those checks into the endpoint methods so invalid arguments fail before creating a session or sending a request, and complete the remaining review cleanup.
_ENDPOINTS,_EndpointSpec,_frozen_spec, and_validate_params. Keep shared date, time, and fixed-choice validation, with explicit required-value and station/station_id checks in the relevant methods. Errors use public Python parameter names.InvalidResponseErrorwhen response-model deserialization fails, and only refresh an ETag from a 304 when the request sentIf-None-Match.coverage[toml]dependency and updating CI and local instructions.IRail,station_id, andvehicle_id. The client has no compatibility alias.Public endpoint signatures and serialized query parameters are unchanged by the validation refactor. Regression tests exercise validation through public methods, including rejection before HTTP activity.
Validation: the combined tree passed 116 offline tests on Python 3.12 and 3.14 with 100% measured statement/branch coverage. Ruff, formatting, and ty passed. The built wheel installed in a fresh Python 3.12 environment and passed isolated import and
py.typedchecks. Live API tests were not run.Integration: this PR still targets
stack/pr-220, the original #220 snapshot. Integrate the latestmainfixes and retarget tomainbefore merging.Summary by CodeRabbit
Breaking Changes
iRailtoIRail.Improvements
Documentation
Testing