Make strict HTTP behavior the default in 1.0
Parent release issue: #282
Depends on: #283
Why
Version 0.9.0 introduced strict_http=True as an opt-in migration path. Version 1.0.0 should complete that migration by making strict handling the default for final non-404 4xx responses.
Scope
Change the default constructor behavior so these are equivalent:
mlbstatsapi.Mlb()
mlbstatsapi.Mlb(strict_http=True)
Default behavior must be:
- Final non-404 4xx responses raise
MlbHttpError
- Final 5xx responses raise
MlbHttpError
- Endpoint-specific 404 behavior remains unchanged
- Retry exhaustion is handled before the final HTTP decision
- Timeout, transport, decode, and validation behavior remain unchanged
Compatibility boundaries
This issue must not:
- Change retry values
- Make 404 responses strict
- Reconfigure caller-injected Sessions
- Change endpoint return models
- Collapse structured exceptions into a generic error
Implementation notes
- Keep
strict_http keyword-only
- Preserve explicit
strict_http=True
- Avoid duplicating strict-mode logic between
Mlb and MlbDataAdapter
- Ensure v1 and v1.1 adapters receive the same resolved default
- Update docstrings and type annotations with the new default
Acceptance criteria
Mlb() raises MlbHttpError for final non-404 4xx responses
MlbDataAdapter() uses the documented 1.0 default when constructed directly
- Explicit
strict_http=True behaves identically to the default
- Endpoint-specific 404 results remain unchanged
- Final 429 raises after retry exhaustion
- Existing Session ownership tests continue passing
- All deterministic HTTP contract tests pass
Suggested branch
feat/v1-strict-http-default
Start from and target:
Make strict HTTP behavior the default in 1.0
Parent release issue: #282
Depends on: #283
Why
Version 0.9.0 introduced
strict_http=Trueas an opt-in migration path. Version 1.0.0 should complete that migration by making strict handling the default for final non-404 4xx responses.Scope
Change the default constructor behavior so these are equivalent:
Default behavior must be:
MlbHttpErrorMlbHttpErrorCompatibility boundaries
This issue must not:
Implementation notes
strict_httpkeyword-onlystrict_http=TrueMlbandMlbDataAdapterAcceptance criteria
Mlb()raisesMlbHttpErrorfor final non-404 4xx responsesMlbDataAdapter()uses the documented 1.0 default when constructed directlystrict_http=Truebehaves identically to the defaultSuggested branch
Start from and target: