Clean quicktype model names#224
Conversation
|
@kieran-osgood-shopify thanks for the review, missed this initially.. I think the latest approach addresses the sed concern, we're just down to a couple of Purple prefix seds R.e. the removed classes, it looks like we're no longer including extensions, just the base schemas. Given current kit enabled delegations, that might be correct - worth checking into though.
|
I've now restored some of the extension files |

What changes are you making?
types/*.jsonschema.types/error_response.jsonas an explicit root becauseCheckoutProtocol.errorexposesErrorResponse.oneOf[0]success branch and reuse canonical checkout payment.Diffs
Removed
Classsuffix duplicatesRemoved
Elementsuffix duplicatesRemoved quicktype color fallbacks
Consolidations
Example
Before
1. CheckoutLineItem (used in
Checkout)2. LineItem (duplicate of CheckoutLineItem)
3. LineItemElement (used in
Order)After
1. LineItem (for checkout, simple quantity)
2. OrderLineItem (for orders, complex quantity)
So the consolidation:
CheckoutLineItem+LineItemduplicates →LineItemLineItemElement→OrderLineItem(clearer purpose)ItemClass→Item,LineItemQuantity→Quantity)Major removals
Some of these were defined in
types/*.jsonbut not actually used in the currentCheckoutorOrderschemas.Some things were separate MessageError, MessageInfo, MessageWarning, but are now consolated into Message with a
typediscriminatorThe net effect: ~70% fewer generated types, all with cleaner names, while the public API surface (
Checkout,Order,ErrorResponse, results) remains stable.Why
Passing every reusable schema as
--srcmade quicktype emit duplicate/fallback models such asBuyerClass,PaymentObject,AdjustmentElement, andPurpleSelectedPaymentInstrument.The new generation keeps callback payload roots intact while using cleaner nested model names.
Review guide
Primary review files:
protocol/scripts/generate_models.shplatforms/android/lib/api/lib.apiGenerated files are large because quicktype reordered/collapsed duplicate model declarations.
API impact
Breaking generated-model API cleanup during alpha.
Public callback roots remain:
CheckoutErrorResponseWindowOpenRequestWindowOpenResultNested callback model names changed, for example:
BuyerClass -> BuyerContextClass -> ContextPaymentClass -> PaymentPaymentSelectedPaymentInstrument -> SelectedPaymentInstrumentMessageElement -> MessageLinkElement -> LinkSome standalone generated types are no longer emitted because they were only generated from broad
types/*.jsonroots and are not reachable from current generated roots.Before you merge
Important
platforms/swift/README.mdand/orplatforms/android/README.md)Releasing a new Swift version?
ShopifyCheckoutKit.podspecplatforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swiftplatforms/swift/CHANGELOG.mdplatforms/swift/README.md(major version only)Releasing a new Android version?
versionNameinplatforms/android/lib/build.gradleplatforms/android/CHANGELOG.mdplatforms/android/README.mdTip
See the Contributing documentation for the full release process per platform.