Skip to content

feat(validation): add ADCP_VALIDATION_MODE env var for JS parity #385

@bokelley

Description

@bokelley

Context

The TS SDK exposes ADCP_VALIDATION_MODE=strict|warn|off as a single env-var override for client validation. The Python SDK only honors ADCP_ENV=prod to flip response default to warn, which is less granular and not parity with the TS SDK.

Additionally, the docstring at src/adcp/client.py:381-383 falsely claims PYTHON_ENV / ENV / ENVIRONMENT are honored — they are not. That doc lies.

Refs:

  • src/adcp/validation/client_hooks.py:62-71 (resolution chain)
  • src/adcp/client.py:381-383 (incorrect docstring)

Acceptance Criteria

  • ADCP_VALIDATION_MODE read in client_hooks.py resolution chain, accepted values strict|warn|off
  • Precedence documented: explicit kwarg > ADCP_VALIDATION_MODE > ADCP_ENV legacy fallback > default
  • When set, applies to both request and response validation hooks (TS-parity behavior)
  • Fix the misleading docstring at client.py:381-383 — remove the bogus PYTHON_ENV / ENV / ENVIRONMENT references
  • Tests cover all three values + invalid value (raises clearly)
  • CHANGELOG note that this matches the TS SDK env-var contract

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions