fix: accept a set of ACP API versions and ignore unknown fields - #11
Merged
Merged
Conversation
The pinned 2025-10-01 is not a released version and the strict comparison rejected every conformant client before any handler ran.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every conformant request was rejected before any handler ran.
1. The version gate
Two faults.
2025-10-01is not a released ACP version — the published ones are2025-09-29,2025-12-12,2026-01-16,2026-01-30and2026-04-17; the value traces to a hypotheticalexample in upstream's
CONTRIBUTING.md. And the strict comparison against a single value meansvalidateRequest()— the first gate in all six controllers — rejected every client regardless ofpayload correctness.
Replaced with membership in a supported-version set, and the failure branch now distinguishes two
cases, both HTTP 400 per
rfc.agentic_checkout.md:codemissing_api_versionunsupported_api_versionBoth carry
type: invalid_requestand asupported_versionsarray, which required a new optionalfield on
ErrorResponseInterface.API_VERSION— the value returned in the response header — is deliberately set to2025-09-29,not the newest accepted version. Accepting a header is not the same as implementing that version,
and the module still emits
2025-09-29-shaped payloads. It should move once the payloads do.This change only ever widens what is accepted, so no client that works today can break.
2. Unknown fields were rejected
The four request DTOs validated with
Assert\Collectioncarrying'allowExtraFields' => false—15 sites. Any field the module did not know was a validation failure.
ACP objects are
additionalProperties: falseupstream and gain optional fields between releases(
Item.suggested_price,Item.url,CheckoutSessionCompleteRequest.fulfillment_detailsarelanding now, and
2026-04-17already added fields this module has never seen). Strict validationturns a routine upstream rollout into an outage with no change on our side.
All 15 set to
true.allowMissingFieldsis untouched — required-field enforcement is correctand survives.
Verification
API-Version: 2025-09-29API-Version: 2026-04-17API-Version: 1999-01-01unsupported_api_version+supported_versionsAPI-Versionheadermissing_api_version+supported_versionsitems$.itemsbuyer.email$.buyer.emailPHPStan level 9 error count unchanged (188 → 188); PHPCS clean on every file touched.
Note for anyone deploying this
symfony/validatoris declared in this module'scomposer.jsonbut is not pulled in when themodule is installed under
app/coderather than via Composer. Without it every request 500s inRequestValidationServicewithClass "Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader" not found,whatever the
API-Versionheader says.Known, not addressed here
POST /checkout_sessionsnow reaches the controller and then 500s inCartToFulfillmentAddress::execute().CheckoutSessionService::assignCartDataToResponse()buildsa fulfillment address unconditionally, so an empty quote address passes
nullintoAddress::setCity(string $city).fulfillment_addressis optional in ACP and should be omittedwhen unset. Separate fix.