Repository navigation
Conversation
quicktype emits every object as a bare z.object, which strips unknown keys on parse, so objects the spec declares open (additionalProperties: true) lost data. A complete checkout request dropped payment.instruments[].credential.token, and checkouts and carts parsed with the base schemas dropped their extension fields. A new generation step, scripts/retain-additional-properties.mjs, appends .catchall(z.any()) to a generated object when every source schema with its property set is open, following $ref and allOf. It looks at the authored, projected and discovery trees together, because one generated object can stand for schemas from more than one of them. Objects that also stand for a closed schema, or for one that does not declare itself open, are left as generated, and the step reports them. 71 objects gain .catchall(z.any()). Six are left as generated: A2ASchema, PriceClassSchema, PriceRangeSchema, ConstraintsElementSchema, FulfillmentCreateRequestSchema and FulfillmentUpdateRequestSchema. The pretest step now compiles extensions.ts as well, so the tests can check that the Extended* schemas keep unknown keys.
catalog_lookup.json's detail_product composes product.json and redeclares options so that options[].values[] are detail_option_value.json, which adds available and exists. The generated GetProductResponseSchema still used the plain option value, so both fields were stripped on parse and DetailOptionValueSchema went unused. The cause is in quicktype: when it intersects two arrays for allOf, it drops the items of the first array it meets (updateArrayItemTypes in quicktype-core's ResolveIntersections), so the base's items won. The projection now moves an array property that redeclares an inherited array with different items into a trailing allOf branch, which is the array whose items quicktype keeps. detail_product is the only such case in the pinned spec. ProductClassSchema.options now uses a new OptionSchema whose values are DetailOptionValueSchema. No other generated schema changes.
damaz91
approved these changes
Oct 5, 2026
damaz91
approved these changes
Oct 5, 2026
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.
Description
Generated objects are bare
z.objects, which strip unknown keys, so objects the spec declares open (additionalProperties: true) lose data on parse.CheckoutCompleteRequestSchema.parse(body)dropspayment.instruments[].credential.token(the credential is the openpayment_credential.json) andap2, and checkouts and carts lose extension fields such asfulfillmentanddiscounts. The getting-started guide on ucp.dev works with the parsed.data, so code that follows it is affected.scripts/retain-additional-properties.mjs, appends.catchall(z.any())to a generated object when every source schema with its property set is open, following$refandallOfacross the authored, projected and discovery trees. 71 objects gain it. Six that also stand for a closed or undeclared schema are left as generated, and the step reports them.GetProductResponseSchemadroppedavailableandexists. quicktype'sallOfintersection of two arrays keeps only one side's items, sodetail_product's redeclaredoptions[].values[]lost toproduct.json's. The projection now moves such a redeclaration into a trailingallOfbranch, the side quicktype keeps.Compatibility: on those 71 objects, parse now keeps unknown keys, and their
z.infertypes gain[k: string]: any, so an unmodelled property is no longer a type error. Closed schemas still strip.Category (Required)
Related Issues
None.
Checklist
!for breaking changes).Screenshots / Logs (if applicable)