Summary
adcp/types/generated_poc/error_details/ contains a generated pydantic model for every
error-details/*.json schema in the bundle — 15 modules, e.g. ActionNotAllowedDetails,
AgentPermissionDeniedDetails, StaleResponseDetails, VersionUnsupportedDetails. Only
one of them, AuthorizationRequiredDetails, is re-exported from adcp.types:
from adcp.types import AuthorizationRequiredDetails # works
from adcp.types import ActionNotAllowedDetails # ImportError
Verified against adcp==6.6.0 / spec 3.1.1. dir(adcp.types) yields exactly one name
ending in Details, and the generated_poc path is documented as not-for-consumers.
Please export the rest.
Why a consumer needs them
error.details is typed dict on the Error model, so nothing at a raise site
constrains what goes in it. Five of these schemas declare required fields —
action-not-allowed (attempted_action, reason), agent-permission-denied
(scope, reason), billing-not-permitted-for-agent (rejected_billing),
stale-response (served_from_cache, cache_age_seconds), version-unsupported
(supported_versions) — and a seller that wants a missing required key to be a
typecheck error rather than a runtime surprise needs the model at the call site.
The models already exist and already encode exactly that. They are simply unreachable,
so every consumer that wants this has to re-declare them locally and then maintain a
guard asserting the local copy still matches the bundle schema — a transcription of
something you already ship, kept in sync by hand.
This is a small, additive change: the models are generated, the schemas are in the
bundle, and AuthorizationRequiredDetails already establishes the precedent for
exporting one.
Suggested shape
Re-export all 15 from adcp/types/__init__.py alongside AuthorizationRequiredDetails.
If a stable public name is wanted for the family, an adcp.types.error_details
subpackage re-exporting them would work equally well for consumers — the requirement is
just that they are importable from a supported path.
Note on extra
The generated models carry extra="allow", which is right for these: several of the
schemas omit additionalProperties, so draft-07 permits extension keys, and a seller
adding diagnostic fields should not be rejected. Two of the schemas do declare
additionalProperties: false; if the generator can reflect that as extra="forbid" on
just those two, the models would carry the distinction the schemas make. Not a blocker
for exporting them.
Related
Summary
adcp/types/generated_poc/error_details/contains a generated pydantic model for everyerror-details/*.jsonschema in the bundle — 15 modules, e.g.ActionNotAllowedDetails,AgentPermissionDeniedDetails,StaleResponseDetails,VersionUnsupportedDetails. Onlyone of them,
AuthorizationRequiredDetails, is re-exported fromadcp.types:Verified against
adcp==6.6.0/ spec 3.1.1.dir(adcp.types)yields exactly one nameending in
Details, and thegenerated_pocpath is documented as not-for-consumers.Please export the rest.
Why a consumer needs them
error.detailsis typeddicton theErrormodel, so nothing at a raise siteconstrains what goes in it. Five of these schemas declare
requiredfields —action-not-allowed(attempted_action,reason),agent-permission-denied(
scope,reason),billing-not-permitted-for-agent(rejected_billing),stale-response(served_from_cache,cache_age_seconds),version-unsupported(
supported_versions) — and a seller that wants a missing required key to be atypecheck error rather than a runtime surprise needs the model at the call site.
The models already exist and already encode exactly that. They are simply unreachable,
so every consumer that wants this has to re-declare them locally and then maintain a
guard asserting the local copy still matches the bundle schema — a transcription of
something you already ship, kept in sync by hand.
This is a small, additive change: the models are generated, the schemas are in the
bundle, and
AuthorizationRequiredDetailsalready establishes the precedent forexporting one.
Suggested shape
Re-export all 15 from
adcp/types/__init__.pyalongsideAuthorizationRequiredDetails.If a stable public name is wanted for the family, an
adcp.types.error_detailssubpackage re-exporting them would work equally well for consumers — the requirement is
just that they are importable from a supported path.
Note on
extraThe generated models carry
extra="allow", which is right for these: several of theschemas omit
additionalProperties, so draft-07 permits extension keys, and a selleradding diagnostic fields should not be rejected. Two of the schemas do declare
additionalProperties: false; if the generator can reflect that asextra="forbid"onjust those two, the models would carry the distinction the schemas make. Not a blocker
for exporting them.
Related
RootModelwrappers makeextrapolicyunsettable by consumers. Same underlying theme: the generated types encode the spec
correctly, but consumers cannot reach or adjust them.