diff --git a/integration-tests-definitions/todo-lists.yaml b/integration-tests-definitions/todo-lists.yaml index d58aa57a5..2ef159672 100644 --- a/integration-tests-definitions/todo-lists.yaml +++ b/integration-tests-definitions/todo-lists.yaml @@ -171,6 +171,9 @@ components: created: type: string format: date-time + x-alpha-transform: + fn: (it) => new Date(it) + type: Date updated: type: string format: date-time diff --git a/integration-tests/typescript-angular/src/generated/todo-lists.yaml/models.ts b/integration-tests/typescript-angular/src/generated/todo-lists.yaml/models.ts index 28740557b..6633a8fe6 100644 --- a/integration-tests/typescript-angular/src/generated/todo-lists.yaml/models.ts +++ b/integration-tests/typescript-angular/src/generated/todo-lists.yaml/models.ts @@ -12,7 +12,7 @@ export type t_CreateUpdateTodoList = { } export type t_TodoList = { - created: string + created: Date id: string incompleteItemCount: number name: string diff --git a/integration-tests/typescript-axios/src/generated/todo-lists.yaml/models.ts b/integration-tests/typescript-axios/src/generated/todo-lists.yaml/models.ts index 28740557b..6633a8fe6 100644 --- a/integration-tests/typescript-axios/src/generated/todo-lists.yaml/models.ts +++ b/integration-tests/typescript-axios/src/generated/todo-lists.yaml/models.ts @@ -12,7 +12,7 @@ export type t_CreateUpdateTodoList = { } export type t_TodoList = { - created: string + created: Date id: string incompleteItemCount: number name: string diff --git a/integration-tests/typescript-fetch/src/generated/todo-lists.yaml/models.ts b/integration-tests/typescript-fetch/src/generated/todo-lists.yaml/models.ts index 28740557b..6633a8fe6 100644 --- a/integration-tests/typescript-fetch/src/generated/todo-lists.yaml/models.ts +++ b/integration-tests/typescript-fetch/src/generated/todo-lists.yaml/models.ts @@ -12,7 +12,7 @@ export type t_CreateUpdateTodoList = { } export type t_TodoList = { - created: string + created: Date id: string incompleteItemCount: number name: string diff --git a/integration-tests/typescript-koa/src/generated/api.github.com.yaml/generated.ts b/integration-tests/typescript-koa/src/generated/api.github.com.yaml/generated.ts index ef65cc54c..576d96c54 100644 --- a/integration-tests/typescript-koa/src/generated/api.github.com.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/generated/api.github.com.yaml/generated.ts @@ -34177,7 +34177,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const migrationsListForOrgQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), - exclude: z.array(z.enum(["repositories"])).optional(), + exclude: z + .union([z.array(z.enum(["repositories"])), z.enum(["repositories"])]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const migrationsListForOrgResponseValidator = responseValidationFactory( @@ -34304,7 +34307,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const migrationsGetStatusForOrgQuerySchema = z.object({ - exclude: z.array(z.enum(["repositories"])).optional(), + exclude: z + .union([z.array(z.enum(["repositories"])), z.enum(["repositories"])]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const migrationsGetStatusForOrgResponseValidator = responseValidationFactory( @@ -36199,7 +36205,10 @@ export function createRouter(implementation: Implementation): KoaRouter { page: z.coerce.number().optional(), sort: z.enum(["created_at"]).optional(), direction: z.enum(["asc", "desc"]).optional(), - owner: z.array(z.string()).max(10).optional(), + owner: z + .union([z.array(z.string()).max(10), z.string()]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), repository: z.string().optional(), permission: z.string().optional(), last_used_before: z.string().datetime({ offset: true }).optional(), @@ -36508,7 +36517,10 @@ export function createRouter(implementation: Implementation): KoaRouter { page: z.coerce.number().optional(), sort: z.enum(["created_at"]).optional(), direction: z.enum(["asc", "desc"]).optional(), - owner: z.array(z.string()).max(10).optional(), + owner: z + .union([z.array(z.string()).max(10), z.string()]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), repository: z.string().optional(), permission: z.string().optional(), last_used_before: z.string().datetime({ offset: true }).optional(), @@ -77418,7 +77430,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const migrationsGetStatusForAuthenticatedUserQuerySchema = z.object({ - exclude: z.array(z.string()).optional(), + exclude: z + .union([z.array(z.string()), z.string()]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const migrationsGetStatusForAuthenticatedUserResponseValidator = diff --git a/integration-tests/typescript-koa/src/generated/azure-core-data-plane-service.tsp/generated.ts b/integration-tests/typescript-koa/src/generated/azure-core-data-plane-service.tsp/generated.ts index cfe4d3124..11a4923b4 100644 --- a/integration-tests/typescript-koa/src/generated/azure-core-data-plane-service.tsp/generated.ts +++ b/integration-tests/typescript-koa/src/generated/azure-core-data-plane-service.tsp/generated.ts @@ -1040,7 +1040,10 @@ export function createRouter(implementation: Implementation): KoaRouter { top: z.coerce.number().optional(), skip: z.coerce.number().optional(), maxpagesize: z.coerce.number().optional(), - select: z.array(z.string()).optional(), + select: z + .union([z.array(z.string()), z.string()]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const widgetsListWidgetsResponseValidator = responseValidationFactory( diff --git a/integration-tests/typescript-koa/src/generated/petstore-expanded.yaml/generated.ts b/integration-tests/typescript-koa/src/generated/petstore-expanded.yaml/generated.ts index e3e0d0e7d..56e9014fc 100644 --- a/integration-tests/typescript-koa/src/generated/petstore-expanded.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/generated/petstore-expanded.yaml/generated.ts @@ -102,7 +102,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const router = new KoaRouter() const findPetsQuerySchema = z.object({ - tags: z.array(z.string()).optional(), + tags: z + .union([z.array(z.string()), z.string()]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), }) diff --git a/integration-tests/typescript-koa/src/generated/stripe.yaml/generated.ts b/integration-tests/typescript-koa/src/generated/stripe.yaml/generated.ts index 73d3b5f00..c170deb7c 100644 --- a/integration-tests/typescript-koa/src/generated/stripe.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/generated/stripe.yaml/generated.ts @@ -13515,7 +13515,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const router = new KoaRouter() const getAccountQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getAccountBodySchema = z.object({}).optional() @@ -13785,7 +13788,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().optional(), }) @@ -14508,7 +14514,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getAccountsAccountQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getAccountsAccountBodySchema = z.object({}).optional() @@ -15289,7 +15298,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getAccountsAccountBankAccountsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getAccountsAccountBankAccountsIdBodySchema = z.object({}).optional() @@ -15434,7 +15446,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getAccountsAccountCapabilitiesQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getAccountsAccountCapabilitiesBodySchema = z.object({}).optional() @@ -15515,7 +15530,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getAccountsAccountCapabilitiesCapabilityQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getAccountsAccountCapabilitiesCapabilityBodySchema = z @@ -15646,7 +15664,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getAccountsAccountExternalAccountsQuerySchema = z.object({ ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), object: z.enum(["bank_account", "card"]).optional(), starting_after: z.string().optional(), @@ -15883,7 +15904,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getAccountsAccountExternalAccountsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getAccountsAccountExternalAccountsIdBodySchema = z.object({}).optional() @@ -16088,7 +16112,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getAccountsAccountPeopleQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), relationship: z .object({ @@ -16436,7 +16463,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getAccountsAccountPeoplePersonQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getAccountsAccountPeoplePersonBodySchema = z.object({}).optional() @@ -16697,7 +16727,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getAccountsAccountPersonsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), relationship: z .object({ @@ -17045,7 +17078,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getAccountsAccountPersonsPersonQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getAccountsAccountPersonsPersonBodySchema = z.object({}).optional() @@ -17362,7 +17398,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getApplePayDomainsQuerySchema = z.object({ domain_name: z.string().max(5000).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -17544,7 +17583,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getApplePayDomainsDomainQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getApplePayDomainsDomainBodySchema = z.object({}).optional() @@ -17617,7 +17659,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -17695,7 +17740,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getApplicationFeesFeeRefundsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getApplicationFeesFeeRefundsIdBodySchema = z.object({}).optional() @@ -17815,7 +17863,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getApplicationFeesIdParamSchema = z.object({ id: z.string().max(5000) }) const getApplicationFeesIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getApplicationFeesIdBodySchema = z.object({}).optional() @@ -17940,7 +17991,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getApplicationFeesIdRefundsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -18079,7 +18133,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getAppsSecretsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), scope: z.object({ type: z.enum(["account", "user"]), @@ -18260,7 +18317,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ) const getAppsSecretsFindQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), name: z.string().max(5000), scope: z.object({ type: z.enum(["account", "user"]), @@ -18321,7 +18381,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ) const getBalanceQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getBalanceBodySchema = z.object({}).optional() @@ -18386,7 +18449,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), currency: z.string().optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), payout: z.string().max(5000).optional(), source: z.string().max(5000).optional(), @@ -18463,7 +18529,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getBalanceHistoryIdParamSchema = z.object({ id: z.string().max(5000) }) const getBalanceHistoryIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getBalanceHistoryIdBodySchema = z.object({}).optional() @@ -18536,7 +18605,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), currency: z.string().optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), payout: z.string().max(5000).optional(), source: z.string().max(5000).optional(), @@ -18619,7 +18691,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getBalanceTransactionsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getBalanceTransactionsIdBodySchema = z.object({}).optional() @@ -18788,7 +18863,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getBillingMetersQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), status: z.enum(["active", "inactive"]).optional(), @@ -18919,7 +18997,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getBillingMetersIdParamSchema = z.object({ id: z.string().max(5000) }) const getBillingMetersIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getBillingMetersIdBodySchema = z.object({}).optional() @@ -19101,7 +19182,10 @@ export function createRouter(implementation: Implementation): KoaRouter { customer: z.string().max(5000), end_time: z.coerce.number(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), start_time: z.coerce.number(), starting_after: z.string().max(5000).optional(), @@ -19242,7 +19326,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getBillingPortalConfigurationsQuerySchema = z.object({ active: PermissiveBoolean.optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), is_default: PermissiveBoolean.optional(), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), @@ -19459,7 +19546,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getBillingPortalConfigurationsConfigurationQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getBillingPortalConfigurationsConfigurationBodySchema = z @@ -19859,7 +19949,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), customer: z.string().max(5000).optional(), ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), payment_intent: z.string().max(5000).optional(), starting_after: z.string().optional(), @@ -20046,7 +20139,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getChargesSearchQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), page: z.string().max(5000).optional(), query: z.string().max(5000), @@ -20122,7 +20218,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getChargesChargeParamSchema = z.object({ charge: z.string().max(5000) }) const getChargesChargeQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getChargesChargeBodySchema = z.object({}).optional() @@ -20332,7 +20431,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getChargesChargeDisputeQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getChargesChargeDisputeBodySchema = z.object({}).optional() @@ -20613,7 +20715,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getChargesChargeRefundsQuerySchema = z.object({ ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().optional(), }) @@ -20767,7 +20872,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getChargesChargeRefundsRefundQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getChargesChargeRefundsRefundBodySchema = z.object({}).optional() @@ -20899,7 +21007,10 @@ export function createRouter(implementation: Implementation): KoaRouter { customer: z.string().max(5000).optional(), customer_details: z.object({ email: z.string() }).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), payment_intent: z.string().max(5000).optional(), payment_link: z.string().max(5000).optional(), @@ -21993,7 +22104,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCheckoutSessionsSessionQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getCheckoutSessionsSessionBodySchema = z.object({}).optional() @@ -22117,7 +22231,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCheckoutSessionsSessionLineItemsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -22199,7 +22316,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getClimateOrdersQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -22324,7 +22444,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getClimateOrdersOrderQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getClimateOrdersOrderBodySchema = z.object({}).optional() @@ -22510,7 +22633,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getClimateProductsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -22587,7 +22713,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getClimateProductsProductQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getClimateProductsProductBodySchema = z.object({}).optional() @@ -22648,7 +22777,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getClimateSuppliersQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -22725,7 +22857,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getClimateSuppliersSupplierQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getClimateSuppliersSupplierBodySchema = z.object({}).optional() @@ -22787,7 +22922,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getConfirmationTokensConfirmationTokenQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getConfirmationTokensConfirmationTokenBodySchema = z @@ -22851,7 +22989,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCountrySpecsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -22924,7 +23065,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCountrySpecsCountryQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getCountrySpecsCountryBodySchema = z.object({}).optional() @@ -22996,7 +23140,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -23187,7 +23334,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCouponsCouponParamSchema = z.object({ coupon: z.string().max(5000) }) const getCouponsCouponQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getCouponsCouponBodySchema = z.object({}).optional() @@ -23317,7 +23467,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), customer: z.string().max(5000).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), invoice: z.string().max(5000).optional(), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), @@ -23484,10 +23637,39 @@ export function createRouter(implementation: Implementation): KoaRouter { amount: z.coerce.number().optional(), credit_amount: z.coerce.number().optional(), effective_at: z.coerce.number().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), invoice: z.string().max(5000), lines: z - .array( + .union([ + z.array( + z.object({ + amount: z.coerce.number().optional(), + description: z.string().max(5000).optional(), + invoice_line_item: z.string().max(5000).optional(), + quantity: z.coerce.number().optional(), + tax_amounts: z + .union([ + z.array( + z.object({ + amount: z.coerce.number(), + tax_rate: z.string().max(5000), + taxable_amount: z.coerce.number(), + }), + ), + z.enum([""]), + ]) + .optional(), + tax_rates: z + .union([z.array(z.string().max(5000)), z.enum([""])]) + .optional(), + type: z.enum(["custom_line_item", "invoice_line_item"]), + unit_amount: z.coerce.number().optional(), + unit_amount_decimal: z.string().optional(), + }), + ), z.object({ amount: z.coerce.number().optional(), description: z.string().max(5000).optional(), @@ -23512,8 +23694,9 @@ export function createRouter(implementation: Implementation): KoaRouter { unit_amount: z.coerce.number().optional(), unit_amount_decimal: z.string().optional(), }), - ) - .optional(), + ]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), memo: z.string().max(5000).optional(), metadata: z.record(z.string()).optional(), out_of_band_amount: z.coerce.number().optional(), @@ -23589,11 +23772,40 @@ export function createRouter(implementation: Implementation): KoaRouter { credit_amount: z.coerce.number().optional(), effective_at: z.coerce.number().optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), invoice: z.string().max(5000), limit: z.coerce.number().optional(), lines: z - .array( + .union([ + z.array( + z.object({ + amount: z.coerce.number().optional(), + description: z.string().max(5000).optional(), + invoice_line_item: z.string().max(5000).optional(), + quantity: z.coerce.number().optional(), + tax_amounts: z + .union([ + z.array( + z.object({ + amount: z.coerce.number(), + tax_rate: z.string().max(5000), + taxable_amount: z.coerce.number(), + }), + ), + z.enum([""]), + ]) + .optional(), + tax_rates: z + .union([z.array(z.string().max(5000)), z.enum([""])]) + .optional(), + type: z.enum(["custom_line_item", "invoice_line_item"]), + unit_amount: z.coerce.number().optional(), + unit_amount_decimal: z.string().optional(), + }), + ), z.object({ amount: z.coerce.number().optional(), description: z.string().max(5000).optional(), @@ -23618,8 +23830,9 @@ export function createRouter(implementation: Implementation): KoaRouter { unit_amount: z.coerce.number().optional(), unit_amount_decimal: z.string().optional(), }), - ) - .optional(), + ]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), memo: z.string().max(5000).optional(), metadata: z.record(z.string()).optional(), out_of_band_amount: z.coerce.number().optional(), @@ -23712,7 +23925,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCreditNotesCreditNoteLinesQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -23792,7 +24008,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCreditNotesIdParamSchema = z.object({ id: z.string().max(5000) }) const getCreditNotesIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getCreditNotesIdBodySchema = z.object({}).optional() @@ -24034,7 +24253,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), email: z.string().max(512).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), test_clock: z.string().max(5000).optional(), @@ -24322,7 +24544,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCustomersSearchQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), page: z.string().max(5000).optional(), query: z.string().max(5000), @@ -24460,7 +24685,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCustomersCustomerQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getCustomersCustomerBodySchema = z.object({}).optional() @@ -24710,7 +24938,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCustomersCustomerBalanceTransactionsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -24862,7 +25093,12 @@ export function createRouter(implementation: Implementation): KoaRouter { z.object({ customer: z.string().max(5000), transaction: z.string() }) const getCustomersCustomerBalanceTransactionsTransactionQuerySchema = - z.object({ expand: z.array(z.string().max(5000)).optional() }) + z.object({ + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), + }) const getCustomersCustomerBalanceTransactionsTransactionBodySchema = z .object({}) @@ -25010,7 +25246,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCustomersCustomerBankAccountsQuerySchema = z.object({ ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().optional(), }) @@ -25261,7 +25500,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCustomersCustomerBankAccountsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getCustomersCustomerBankAccountsIdBodySchema = z.object({}).optional() @@ -25493,7 +25735,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCustomersCustomerCardsQuerySchema = z.object({ ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().optional(), }) @@ -25739,7 +25984,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCustomersCustomerCardsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getCustomersCustomerCardsIdBodySchema = z.object({}).optional() @@ -25901,7 +26149,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCustomersCustomerCashBalanceQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getCustomersCustomerCashBalanceBodySchema = z.object({}).optional() @@ -26029,7 +26280,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCustomersCustomerCashBalanceTransactionsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -26115,7 +26369,12 @@ export function createRouter(implementation: Implementation): KoaRouter { z.object({ customer: z.string().max(5000), transaction: z.string() }) const getCustomersCustomerCashBalanceTransactionsTransactionQuerySchema = - z.object({ expand: z.array(z.string().max(5000)).optional() }) + z.object({ + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), + }) const getCustomersCustomerCashBalanceTransactionsTransactionBodySchema = z .object({}) @@ -26245,7 +26504,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCustomersCustomerDiscountQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getCustomersCustomerDiscountBodySchema = z.object({}).optional() @@ -26383,7 +26645,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCustomersCustomerPaymentMethodsQuerySchema = z.object({ allow_redisplay: z.enum(["always", "limited", "unspecified"]).optional(), ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().optional(), type: z @@ -26510,7 +26775,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCustomersCustomerPaymentMethodsPaymentMethodQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getCustomersCustomerPaymentMethodsPaymentMethodBodySchema = z @@ -26579,7 +26847,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCustomersCustomerSourcesQuerySchema = z.object({ ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), object: z.string().max(5000).optional(), starting_after: z.string().optional(), @@ -26831,7 +27102,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCustomersCustomerSourcesIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getCustomersCustomerSourcesIdBodySchema = z.object({}).optional() @@ -27057,7 +27331,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCustomersCustomerSubscriptionsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -27608,7 +27885,12 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCustomersCustomerSubscriptionsSubscriptionExposedIdQuerySchema = - z.object({ expand: z.array(z.string().max(5000)).optional() }) + z.object({ + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), + }) const getCustomersCustomerSubscriptionsSubscriptionExposedIdBodySchema = z .object({}) @@ -28178,7 +28460,12 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCustomersCustomerSubscriptionsSubscriptionExposedIdDiscountQuerySchema = - z.object({ expand: z.array(z.string().max(5000)).optional() }) + z.object({ + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), + }) const getCustomersCustomerSubscriptionsSubscriptionExposedIdDiscountBodySchema = z.object({}).optional() @@ -28249,7 +28536,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getCustomersCustomerTaxIdsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -28517,7 +28807,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getCustomersCustomerTaxIdsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getCustomersCustomerTaxIdsIdBodySchema = z.object({}).optional() @@ -28588,7 +28881,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), payment_intent: z.string().max(5000).optional(), starting_after: z.string().max(5000).optional(), @@ -28662,7 +28958,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getDisputesDisputeQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getDisputesDisputeBodySchema = z.object({}).optional() @@ -28875,7 +29174,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getEntitlementsActiveEntitlementsQuerySchema = z.object({ customer: z.string().max(5000), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -28956,7 +29258,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getEntitlementsActiveEntitlementsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getEntitlementsActiveEntitlementsIdBodySchema = z.object({}).optional() @@ -29022,7 +29327,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getEntitlementsFeaturesQuerySchema = z.object({ archived: PermissiveBoolean.optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), lookup_key: z.string().max(5000).optional(), starting_after: z.string().max(5000).optional(), @@ -29156,7 +29464,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getEntitlementsFeaturesIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getEntitlementsFeaturesIdBodySchema = z.object({}).optional() @@ -29402,11 +29713,17 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), delivery_success: PermissiveBoolean.optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), type: z.string().max(5000).optional(), - types: z.array(z.string().max(5000)).optional(), + types: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getEventsBodySchema = z.object({}).optional() @@ -29475,7 +29792,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getEventsIdParamSchema = z.object({ id: z.string().max(5000) }) const getEventsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getEventsIdBodySchema = z.object({}).optional() @@ -29532,7 +29852,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getExchangeRatesQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -29605,7 +29928,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getExchangeRatesRateIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getExchangeRatesRateIdBodySchema = z.object({}).optional() @@ -29677,7 +30003,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), expired: PermissiveBoolean.optional(), file: z.string().max(5000).optional(), limit: z.coerce.number().optional(), @@ -29799,7 +30128,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getFileLinksLinkParamSchema = z.object({ link: z.string() }) const getFileLinksLinkQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getFileLinksLinkBodySchema = z.object({}).optional() @@ -29929,7 +30261,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), purpose: z .enum([ @@ -30085,7 +30420,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getFilesFileParamSchema = z.object({ file: z.string().max(5000) }) const getFilesFileQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getFilesFileBodySchema = z.object({}).optional() @@ -30148,7 +30486,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), session: z.string().max(5000).optional(), starting_after: z.string().max(5000).optional(), @@ -30230,7 +30571,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getFinancialConnectionsAccountsAccountQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getFinancialConnectionsAccountsAccountBodySchema = z @@ -30368,7 +30712,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getFinancialConnectionsAccountsAccountOwnersQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), ownership: z.string().max(5000), starting_after: z.string().max(5000).optional(), @@ -30719,7 +31066,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getFinancialConnectionsSessionsSessionQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getFinancialConnectionsSessionsSessionBodySchema = z @@ -30787,7 +31137,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getFinancialConnectionsTransactionsQuerySchema = z.object({ account: z.string().max(5000), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), transacted_at: z @@ -30883,7 +31236,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getFinancialConnectionsTransactionsTransactionQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getFinancialConnectionsTransactionsTransactionBodySchema = z @@ -30961,7 +31317,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -31106,7 +31465,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getForwardingRequestsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getForwardingRequestsIdBodySchema = z.object({}).optional() @@ -31179,7 +31541,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), type: z.enum(["document", "id_number"]).optional(), @@ -31262,7 +31627,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getIdentityVerificationReportsReportQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getIdentityVerificationReportsReportBodySchema = z.object({}).optional() @@ -31339,7 +31707,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), status: z @@ -31501,7 +31872,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getIdentityVerificationSessionsSessionQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getIdentityVerificationSessionsSessionBodySchema = z @@ -31790,7 +32164,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), customer: z.string().max(5000).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), invoice: z.string().max(5000).optional(), limit: z.coerce.number().optional(), pending: PermissiveBoolean.optional(), @@ -32006,7 +32383,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getInvoiceitemsInvoiceitemQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getInvoiceitemsInvoiceitemBodySchema = z.object({}).optional() @@ -32192,7 +32572,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), status: z @@ -33113,7 +33496,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ) const getInvoicesSearchQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), page: z.string().max(5000).optional(), query: z.string().max(5000), @@ -33334,9 +33720,59 @@ export function createRouter(implementation: Implementation): KoaRouter { z.enum([""]), ]) .optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), invoice_items: z - .array( + .union([ + z.array( + z.object({ + amount: z.coerce.number().optional(), + currency: z.string().optional(), + description: z.string().max(5000).optional(), + discountable: PermissiveBoolean.optional(), + discounts: z + .union([ + z.array( + z.object({ + coupon: z.string().max(5000).optional(), + discount: z.string().max(5000).optional(), + promotion_code: z.string().max(5000).optional(), + }), + ), + z.enum([""]), + ]) + .optional(), + invoiceitem: z.string().max(5000).optional(), + metadata: z.union([z.record(z.string()), z.enum([""])]).optional(), + period: z + .object({ end: z.coerce.number(), start: z.coerce.number() }) + .optional(), + price: z.string().max(5000).optional(), + price_data: z + .object({ + currency: z.string(), + product: z.string().max(5000), + tax_behavior: z + .enum(["exclusive", "inclusive", "unspecified"]) + .optional(), + unit_amount: z.coerce.number().optional(), + unit_amount_decimal: z.string().optional(), + }) + .optional(), + quantity: z.coerce.number().optional(), + tax_behavior: z + .enum(["exclusive", "inclusive", "unspecified"]) + .optional(), + tax_code: z.union([z.string(), z.enum([""])]).optional(), + tax_rates: z + .union([z.array(z.string().max(5000)), z.enum([""])]) + .optional(), + unit_amount: z.coerce.number().optional(), + unit_amount_decimal: z.string().optional(), + }), + ), z.object({ amount: z.coerce.number().optional(), currency: z.string().optional(), @@ -33382,8 +33818,9 @@ export function createRouter(implementation: Implementation): KoaRouter { unit_amount: z.coerce.number().optional(), unit_amount_decimal: z.string().optional(), }), - ) - .optional(), + ]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), issuer: z .object({ account: z.string().optional(), @@ -33647,7 +34084,50 @@ export function createRouter(implementation: Implementation): KoaRouter { }) .optional(), subscription_items: z - .array( + .union([ + z.array( + z.object({ + billing_thresholds: z + .union([z.object({ usage_gte: z.coerce.number() }), z.enum([""])]) + .optional(), + clear_usage: PermissiveBoolean.optional(), + deleted: PermissiveBoolean.optional(), + discounts: z + .union([ + z.array( + z.object({ + coupon: z.string().max(5000).optional(), + discount: z.string().max(5000).optional(), + promotion_code: z.string().max(5000).optional(), + }), + ), + z.enum([""]), + ]) + .optional(), + id: z.string().max(5000).optional(), + metadata: z.union([z.record(z.string()), z.enum([""])]).optional(), + price: z.string().max(5000).optional(), + price_data: z + .object({ + currency: z.string(), + product: z.string().max(5000), + recurring: z.object({ + interval: z.enum(["day", "month", "week", "year"]), + interval_count: z.coerce.number().optional(), + }), + tax_behavior: z + .enum(["exclusive", "inclusive", "unspecified"]) + .optional(), + unit_amount: z.coerce.number().optional(), + unit_amount_decimal: z.string().optional(), + }) + .optional(), + quantity: z.coerce.number().optional(), + tax_rates: z + .union([z.array(z.string().max(5000)), z.enum([""])]) + .optional(), + }), + ), z.object({ billing_thresholds: z .union([z.object({ usage_gte: z.coerce.number() }), z.enum([""])]) @@ -33689,8 +34169,9 @@ export function createRouter(implementation: Implementation): KoaRouter { .union([z.array(z.string().max(5000)), z.enum([""])]) .optional(), }), - ) - .optional(), + ]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), subscription_proration_behavior: z .enum(["always_invoice", "create_prorations", "none"]) .optional(), @@ -33903,9 +34384,59 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), invoice_items: z - .array( + .union([ + z.array( + z.object({ + amount: z.coerce.number().optional(), + currency: z.string().optional(), + description: z.string().max(5000).optional(), + discountable: PermissiveBoolean.optional(), + discounts: z + .union([ + z.array( + z.object({ + coupon: z.string().max(5000).optional(), + discount: z.string().max(5000).optional(), + promotion_code: z.string().max(5000).optional(), + }), + ), + z.enum([""]), + ]) + .optional(), + invoiceitem: z.string().max(5000).optional(), + metadata: z.union([z.record(z.string()), z.enum([""])]).optional(), + period: z + .object({ end: z.coerce.number(), start: z.coerce.number() }) + .optional(), + price: z.string().max(5000).optional(), + price_data: z + .object({ + currency: z.string(), + product: z.string().max(5000), + tax_behavior: z + .enum(["exclusive", "inclusive", "unspecified"]) + .optional(), + unit_amount: z.coerce.number().optional(), + unit_amount_decimal: z.string().optional(), + }) + .optional(), + quantity: z.coerce.number().optional(), + tax_behavior: z + .enum(["exclusive", "inclusive", "unspecified"]) + .optional(), + tax_code: z.union([z.string(), z.enum([""])]).optional(), + tax_rates: z + .union([z.array(z.string().max(5000)), z.enum([""])]) + .optional(), + unit_amount: z.coerce.number().optional(), + unit_amount_decimal: z.string().optional(), + }), + ), z.object({ amount: z.coerce.number().optional(), currency: z.string().optional(), @@ -33951,8 +34482,9 @@ export function createRouter(implementation: Implementation): KoaRouter { unit_amount: z.coerce.number().optional(), unit_amount_decimal: z.string().optional(), }), - ) - .optional(), + ]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), issuer: z .object({ account: z.string().optional(), @@ -34218,7 +34750,50 @@ export function createRouter(implementation: Implementation): KoaRouter { }) .optional(), subscription_items: z - .array( + .union([ + z.array( + z.object({ + billing_thresholds: z + .union([z.object({ usage_gte: z.coerce.number() }), z.enum([""])]) + .optional(), + clear_usage: PermissiveBoolean.optional(), + deleted: PermissiveBoolean.optional(), + discounts: z + .union([ + z.array( + z.object({ + coupon: z.string().max(5000).optional(), + discount: z.string().max(5000).optional(), + promotion_code: z.string().max(5000).optional(), + }), + ), + z.enum([""]), + ]) + .optional(), + id: z.string().max(5000).optional(), + metadata: z.union([z.record(z.string()), z.enum([""])]).optional(), + price: z.string().max(5000).optional(), + price_data: z + .object({ + currency: z.string(), + product: z.string().max(5000), + recurring: z.object({ + interval: z.enum(["day", "month", "week", "year"]), + interval_count: z.coerce.number().optional(), + }), + tax_behavior: z + .enum(["exclusive", "inclusive", "unspecified"]) + .optional(), + unit_amount: z.coerce.number().optional(), + unit_amount_decimal: z.string().optional(), + }) + .optional(), + quantity: z.coerce.number().optional(), + tax_rates: z + .union([z.array(z.string().max(5000)), z.enum([""])]) + .optional(), + }), + ), z.object({ billing_thresholds: z .union([z.object({ usage_gte: z.coerce.number() }), z.enum([""])]) @@ -34260,8 +34835,9 @@ export function createRouter(implementation: Implementation): KoaRouter { .union([z.array(z.string().max(5000)), z.enum([""])]) .optional(), }), - ) - .optional(), + ]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), subscription_proration_behavior: z .enum(["always_invoice", "create_prorations", "none"]) .optional(), @@ -34401,7 +34977,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getInvoicesInvoiceQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getInvoicesInvoiceBodySchema = z.object({}).optional() @@ -34890,7 +35469,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getInvoicesInvoiceLinesQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -35364,7 +35946,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), status: z.enum(["closed", "pending", "reversed"]).optional(), @@ -35445,7 +36030,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getIssuingAuthorizationsAuthorizationQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getIssuingAuthorizationsAuthorizationBodySchema = z @@ -35708,7 +36296,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), email: z.string().optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), phone_number: z.string().optional(), starting_after: z.string().max(5000).optional(), @@ -36822,7 +37413,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getIssuingCardholdersCardholderQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getIssuingCardholdersCardholderBodySchema = z.object({}).optional() @@ -37934,7 +38528,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ending_before: z.string().max(5000).optional(), exp_month: z.coerce.number().optional(), exp_year: z.coerce.number().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), last4: z.string().max(5000).optional(), limit: z.coerce.number().optional(), personalization_design: z.string().max(5000).optional(), @@ -39016,7 +39613,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getIssuingCardsCardQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getIssuingCardsCardBodySchema = z.object({}).optional() @@ -40079,7 +40679,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), status: z @@ -40394,7 +40997,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getIssuingDisputesDisputeQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getIssuingDisputesDisputeBodySchema = z.object({}).optional() @@ -40754,9 +41360,15 @@ export function createRouter(implementation: Implementation): KoaRouter { const getIssuingPersonalizationDesignsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), - lookup_keys: z.array(z.string().max(200)).optional(), + lookup_keys: z + .union([z.array(z.string().max(200)), z.string().max(200)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), preferences: z .object({ is_default: PermissiveBoolean.optional(), @@ -40911,7 +41523,12 @@ export function createRouter(implementation: Implementation): KoaRouter { z.object({ personalization_design: z.string().max(5000) }) const getIssuingPersonalizationDesignsPersonalizationDesignQuerySchema = - z.object({ expand: z.array(z.string().max(5000)).optional() }) + z.object({ + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), + }) const getIssuingPersonalizationDesignsPersonalizationDesignBodySchema = z .object({}) @@ -41076,7 +41693,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getIssuingPhysicalBundlesQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), status: z.enum(["active", "inactive", "review"]).optional(), @@ -41158,7 +41778,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getIssuingPhysicalBundlesPhysicalBundleQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getIssuingPhysicalBundlesPhysicalBundleBodySchema = z @@ -41225,7 +41848,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getIssuingSettlementsSettlementQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getIssuingSettlementsSettlementBodySchema = z.object({}).optional() @@ -41355,7 +41981,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), status: z.enum(["active", "deleted", "requested", "suspended"]).optional(), @@ -41429,7 +42058,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getIssuingTokensTokenQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getIssuingTokensTokenBodySchema = z.object({}).optional() @@ -41562,7 +42194,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), type: z.enum(["capture", "refund"]).optional(), @@ -41643,7 +42278,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getIssuingTransactionsTransactionQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getIssuingTransactionsTransactionBodySchema = z.object({}).optional() @@ -41835,7 +42473,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getLinkAccountSessionsSessionQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getLinkAccountSessionsSessionBodySchema = z.object({}).optional() @@ -41903,7 +42544,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), session: z.string().max(5000).optional(), starting_after: z.string().max(5000).optional(), @@ -41980,7 +42624,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getLinkedAccountsAccountQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getLinkedAccountsAccountBodySchema = z.object({}).optional() @@ -42107,7 +42754,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getLinkedAccountsAccountOwnersQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), ownership: z.string().max(5000), starting_after: z.string().max(5000).optional(), @@ -42248,7 +42898,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getMandatesMandateParamSchema = z.object({ mandate: z.string() }) const getMandatesMandateQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getMandatesMandateBodySchema = z.object({}).optional() @@ -42321,7 +42974,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), customer: z.string().max(5000).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -43394,7 +44050,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ) const getPaymentIntentsSearchQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), page: z.string().max(5000).optional(), query: z.string().max(5000), @@ -43477,7 +44136,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getPaymentIntentsIntentQuerySchema = z.object({ client_secret: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getPaymentIntentsIntentBodySchema = z.object({}).optional() @@ -45866,7 +46528,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getPaymentLinksQuerySchema = z.object({ active: PermissiveBoolean.optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -46466,7 +47131,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getPaymentLinksPaymentLinkQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getPaymentLinksPaymentLinkBodySchema = z.object({}).optional() @@ -47069,7 +47737,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getPaymentLinksPaymentLinkLineItemsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -47152,7 +47823,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getPaymentMethodConfigurationsQuerySchema = z.object({ application: z.union([z.string().max(100), z.enum([""])]).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -47568,7 +48242,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getPaymentMethodConfigurationsConfigurationQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getPaymentMethodConfigurationsConfigurationBodySchema = z @@ -47983,7 +48660,10 @@ export function createRouter(implementation: Implementation): KoaRouter { domain_name: z.string().max(5000).optional(), enabled: PermissiveBoolean.optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -48115,7 +48795,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getPaymentMethodDomainsPaymentMethodDomainQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getPaymentMethodDomainsPaymentMethodDomainBodySchema = z @@ -48305,7 +48988,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getPaymentMethodsQuerySchema = z.object({ customer: z.string().max(5000).optional(), ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().optional(), type: z @@ -48748,7 +49434,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getPaymentMethodsPaymentMethodQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getPaymentMethodsPaymentMethodBodySchema = z.object({}).optional() @@ -49049,7 +49738,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), destination: z.string().optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), status: z.string().max(5000).optional(), @@ -49175,7 +49867,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getPayoutsPayoutParamSchema = z.object({ payout: z.string().max(5000) }) const getPayoutsPayoutQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getPayoutsPayoutBodySchema = z.object({}).optional() @@ -49420,7 +50115,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), product: z.string().max(5000).optional(), starting_after: z.string().max(5000).optional(), @@ -49633,7 +50331,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getPlansPlanParamSchema = z.object({ plan: z.string().max(5000) }) const getPlansPlanQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getPlansPlanBodySchema = z.object({}).optional() @@ -49762,9 +50463,15 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), currency: z.string().optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), - lookup_keys: z.array(z.string().max(5000)).optional(), + lookup_keys: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), product: z.string().max(5000).optional(), recurring: z .object({ @@ -49973,7 +50680,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getPricesSearchQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), page: z.string().max(5000).optional(), query: z.string().max(5000), @@ -50049,7 +50759,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getPricesPriceParamSchema = z.object({ price: z.string().max(5000) }) const getPricesPriceQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getPricesPriceBodySchema = z.object({}).optional() @@ -50213,8 +50926,14 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), - ids: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), + ids: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), shippable: PermissiveBoolean.optional(), starting_after: z.string().max(5000).optional(), @@ -50399,7 +51118,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getProductsSearchQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), page: z.string().max(5000).optional(), query: z.string().max(5000), @@ -50525,7 +51247,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getProductsIdParamSchema = z.object({ id: z.string().max(5000) }) const getProductsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getProductsIdBodySchema = z.object({}).optional() @@ -50668,7 +51393,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getProductsProductFeaturesQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -50862,7 +51590,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getProductsProductFeaturesIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getProductsProductFeaturesIdBodySchema = z.object({}).optional() @@ -50936,7 +51667,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), customer: z.string().max(5000).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -51076,7 +51810,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getPromotionCodesPromotionCodeQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getPromotionCodesPromotionCodeBodySchema = z.object({}).optional() @@ -51203,7 +51940,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getQuotesQuerySchema = z.object({ customer: z.string().max(5000).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), status: z.enum(["accepted", "canceled", "draft", "open"]).optional(), @@ -51450,7 +52190,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getQuotesQuoteParamSchema = z.object({ quote: z.string().max(5000) }) const getQuotesQuoteQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getQuotesQuoteBodySchema = z.object({}).optional() @@ -51801,7 +52544,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getQuotesQuoteComputedUpfrontLineItemsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -51950,7 +52696,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getQuotesQuoteLineItemsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -52029,7 +52778,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getQuotesQuotePdfParamSchema = z.object({ quote: z.string().max(5000) }) const getQuotesQuotePdfQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getQuotesQuotePdfBodySchema = z.object({}).optional() @@ -52102,7 +52854,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), payment_intent: z.string().max(5000).optional(), starting_after: z.string().max(5000).optional(), @@ -52183,7 +52938,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getRadarEarlyFraudWarningsEarlyFraudWarningQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getRadarEarlyFraudWarningsEarlyFraudWarningBodySchema = z @@ -52258,7 +53016,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), value: z.string().max(800).optional(), @@ -52449,7 +53210,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getRadarValueListItemsItemQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getRadarValueListItemsItemBodySchema = z.object({}).optional() @@ -52523,7 +53287,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -52721,7 +53488,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getRadarValueListsValueListQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getRadarValueListsValueListBodySchema = z.object({}).optional() @@ -52853,7 +53623,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), payment_intent: z.string().max(5000).optional(), starting_after: z.string().optional(), @@ -52986,7 +53759,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getRefundsRefundParamSchema = z.object({ refund: z.string() }) const getRefundsRefundQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getRefundsRefundBodySchema = z.object({}).optional() @@ -53165,7 +53941,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -53949,7 +54728,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getReportingReportRunsReportRunQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getReportingReportRunsReportRunBodySchema = z.object({}).optional() @@ -54007,7 +54789,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ) const getReportingReportTypesQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getReportingReportTypesBodySchema = z.object({}).optional() @@ -54082,7 +54867,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getReportingReportTypesReportTypeQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getReportingReportTypesReportTypeBodySchema = z.object({}).optional() @@ -54155,7 +54943,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -54226,7 +55017,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getReviewsReviewParamSchema = z.object({ review: z.string().max(5000) }) const getReviewsReviewQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getReviewsReviewBodySchema = z.object({}).optional() @@ -54352,7 +55146,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), setup_intent: z.string().max(5000), starting_after: z.string().max(5000).optional(), @@ -54436,7 +55233,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), customer: z.string().max(5000).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), payment_method: z.string().max(5000).optional(), starting_after: z.string().max(5000).optional(), @@ -54998,7 +55798,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getSetupIntentsIntentQuerySchema = z.object({ client_secret: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getSetupIntentsIntentBodySchema = z.object({}).optional() @@ -56151,7 +56954,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), currency: z.string().optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -56307,7 +57113,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getShippingRatesShippingRateTokenQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getShippingRatesShippingRateTokenBodySchema = z.object({}).optional() @@ -56449,7 +57258,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getSigmaScheduledQueryRunsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -56529,7 +57341,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getSigmaScheduledQueryRunsScheduledQueryRunQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getSigmaScheduledQueryRunsScheduledQueryRunBodySchema = z @@ -56745,7 +57560,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getSourcesSourceQuerySchema = z.object({ client_secret: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getSourcesSourceBodySchema = z.object({}).optional() @@ -56947,7 +57765,12 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getSourcesSourceMandateNotificationsMandateNotificationQuerySchema = - z.object({ expand: z.array(z.string().max(5000)).optional() }) + z.object({ + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), + }) const getSourcesSourceMandateNotificationsMandateNotificationBodySchema = z .object({}) @@ -57019,7 +57842,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getSourcesSourceSourceTransactionsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -57106,7 +57932,12 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getSourcesSourceSourceTransactionsSourceTransactionQuerySchema = - z.object({ expand: z.array(z.string().max(5000)).optional() }) + z.object({ + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), + }) const getSourcesSourceSourceTransactionsSourceTransactionBodySchema = z .object({}) @@ -57233,7 +58064,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getSubscriptionItemsQuerySchema = z.object({ ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().optional(), subscription: z.string().max(5000), @@ -57475,7 +58309,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getSubscriptionItemsItemQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getSubscriptionItemsItemBodySchema = z.object({}).optional() @@ -57649,7 +58486,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getSubscriptionItemsSubscriptionItemUsageRecordSummariesQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -57839,7 +58679,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), customer: z.string().max(5000).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), released_at: z .union([ @@ -58200,7 +59043,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getSubscriptionSchedulesScheduleQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getSubscriptionSchedulesScheduleBodySchema = z.object({}).optional() @@ -58702,7 +59548,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), customer: z.string().max(5000).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), price: z.string().max(5000).optional(), starting_after: z.string().max(5000).optional(), @@ -59174,7 +60023,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getSubscriptionsSearchQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), page: z.string().max(5000).optional(), query: z.string().max(5000), @@ -59337,7 +60189,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getSubscriptionsSubscriptionExposedIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getSubscriptionsSubscriptionExposedIdBodySchema = z @@ -60143,7 +60998,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTaxCalculationsCalculationLineItemsQuerySchema = z.object({ ending_before: z.string().max(500).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(500).optional(), }) @@ -60230,7 +61088,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTaxRegistrationsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), status: z.enum(["active", "all", "expired", "scheduled"]).optional(), @@ -60685,7 +61546,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTaxRegistrationsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTaxRegistrationsIdBodySchema = z.object({}).optional() @@ -60809,7 +61673,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ) const getTaxSettingsQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTaxSettingsBodySchema = z.object({}).optional() @@ -61058,7 +61925,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTaxTransactionsTransactionQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTaxTransactionsTransactionBodySchema = z.object({}).optional() @@ -61121,7 +61991,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTaxTransactionsTransactionLineItemsQuerySchema = z.object({ ending_before: z.string().max(500).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(500).optional(), }) @@ -61208,7 +62081,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTaxCodesQuerySchema = z.object({ ending_before: z.string().optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().optional(), }) @@ -61279,7 +62155,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTaxCodesIdParamSchema = z.object({ id: z.string().max(5000) }) const getTaxCodesIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTaxCodesIdBodySchema = z.object({}).optional() @@ -61336,7 +62215,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTaxIdsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), owner: z .object({ @@ -61592,7 +62474,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTaxIdsIdParamSchema = z.object({ id: z.string().max(5000) }) const getTaxIdsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTaxIdsIdBodySchema = z.object({}).optional() @@ -61661,7 +62546,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), inclusive: PermissiveBoolean.optional(), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), @@ -61806,7 +62694,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTaxRatesTaxRateQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTaxRatesTaxRateBodySchema = z.object({}).optional() @@ -61950,7 +62841,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTerminalConfigurationsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), is_account_default: PermissiveBoolean.optional(), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), @@ -62269,7 +63163,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTerminalConfigurationsConfigurationQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTerminalConfigurationsConfigurationBodySchema = z @@ -62604,7 +63501,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTerminalLocationsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -62799,7 +63699,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTerminalLocationsLocationQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTerminalLocationsLocationBodySchema = z.object({}).optional() @@ -62952,7 +63855,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), location: z.string().max(5000).optional(), serial_number: z.string().max(5000).optional(), @@ -63140,7 +64046,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTerminalReadersReaderQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTerminalReadersReaderBodySchema = z.object({}).optional() @@ -66288,7 +67197,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTestHelpersTestClocksQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -66480,7 +67392,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTestHelpersTestClocksTestClockQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTestHelpersTestClocksTestClockBodySchema = z.object({}).optional() @@ -67930,7 +68845,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTokensTokenParamSchema = z.object({ token: z.string().max(5000) }) const getTokensTokenQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTokensTokenBodySchema = z.object({}).optional() @@ -68009,7 +68927,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), status: z.enum(["canceled", "failed", "pending", "succeeded"]).optional(), @@ -68134,7 +69055,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTopupsTopupParamSchema = z.object({ topup: z.string().max(5000) }) const getTopupsTopupQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTopupsTopupBodySchema = z.object({}).optional() @@ -68317,7 +69241,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), destination: z.string().max(5000).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), transfer_group: z.string().max(5000).optional(), @@ -68446,7 +69373,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTransfersIdReversalsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -68591,7 +69521,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTransfersTransferQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTransfersTransferBodySchema = z.object({}).optional() @@ -68718,7 +69651,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTransfersTransferReversalsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTransfersTransferReversalsIdBodySchema = z.object({}).optional() @@ -68837,7 +69773,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTreasuryCreditReversalsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), financial_account: z.string(), limit: z.coerce.number().optional(), received_credit: z.string().max(5000).optional(), @@ -68967,7 +69906,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTreasuryCreditReversalsCreditReversalQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTreasuryCreditReversalsCreditReversalBodySchema = z @@ -69031,7 +69973,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTreasuryDebitReversalsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), financial_account: z.string(), limit: z.coerce.number().optional(), received_debit: z.string().max(5000).optional(), @@ -69164,7 +70109,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTreasuryDebitReversalsDebitReversalQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTreasuryDebitReversalsDebitReversalBodySchema = z @@ -69239,7 +70187,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -69413,7 +70364,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTreasuryFinancialAccountsFinancialAccountQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTreasuryFinancialAccountsFinancialAccountBodySchema = z @@ -69584,7 +70538,12 @@ export function createRouter(implementation: Implementation): KoaRouter { z.object({ financial_account: z.string().max(5000) }) const getTreasuryFinancialAccountsFinancialAccountFeaturesQuerySchema = - z.object({ expand: z.array(z.string().max(5000)).optional() }) + z.object({ + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), + }) const getTreasuryFinancialAccountsFinancialAccountFeaturesBodySchema = z .object({}) @@ -69752,7 +70711,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTreasuryInboundTransfersQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), financial_account: z.string(), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), @@ -69889,7 +70851,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTreasuryInboundTransfersIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTreasuryInboundTransfersIdBodySchema = z.object({}).optional() @@ -70024,7 +70989,10 @@ export function createRouter(implementation: Implementation): KoaRouter { .optional(), customer: z.string().max(5000).optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), financial_account: z.string(), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), @@ -70216,7 +71184,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTreasuryOutboundPaymentsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTreasuryOutboundPaymentsIdBodySchema = z.object({}).optional() @@ -70334,7 +71305,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTreasuryOutboundTransfersQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), financial_account: z.string(), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), @@ -70483,7 +71457,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTreasuryOutboundTransfersOutboundTransferQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTreasuryOutboundTransfersOutboundTransferBodySchema = z @@ -70610,7 +71587,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTreasuryReceivedCreditsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), financial_account: z.string(), limit: z.coerce.number().optional(), linked_flows: z @@ -70699,7 +71679,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTreasuryReceivedCreditsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTreasuryReceivedCreditsIdBodySchema = z.object({}).optional() @@ -70758,7 +71741,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getTreasuryReceivedDebitsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), financial_account: z.string(), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), @@ -70837,7 +71823,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTreasuryReceivedDebitsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTreasuryReceivedDebitsIdBodySchema = z.object({}).optional() @@ -70918,7 +71907,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), financial_account: z.string(), limit: z.coerce.number().optional(), order_by: z.enum(["created", "effective_at"]).optional(), @@ -71002,7 +71994,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTreasuryTransactionEntriesIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTreasuryTransactionEntriesIdBodySchema = z.object({}).optional() @@ -71072,7 +72067,10 @@ export function createRouter(implementation: Implementation): KoaRouter { ]) .optional(), ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), financial_account: z.string(), limit: z.coerce.number().optional(), order_by: z.enum(["created", "posted_at"]).optional(), @@ -71167,7 +72165,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getTreasuryTransactionsIdQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getTreasuryTransactionsIdBodySchema = z.object({}).optional() @@ -71228,7 +72229,10 @@ export function createRouter(implementation: Implementation): KoaRouter { const getWebhookEndpointsQuerySchema = z.object({ ending_before: z.string().max(5000).optional(), - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), limit: z.coerce.number().optional(), starting_after: z.string().max(5000).optional(), }) @@ -71762,7 +72766,10 @@ export function createRouter(implementation: Implementation): KoaRouter { }) const getWebhookEndpointsWebhookEndpointQuerySchema = z.object({ - expand: z.array(z.string().max(5000)).optional(), + expand: z + .union([z.array(z.string().max(5000)), z.string().max(5000)]) + .optional() + .transform((it) => (Array.isArray(it) || it === undefined ? it : [it])), }) const getWebhookEndpointsWebhookEndpointBodySchema = z.object({}).optional() diff --git a/integration-tests/typescript-koa/src/generated/todo-lists.yaml/models.ts b/integration-tests/typescript-koa/src/generated/todo-lists.yaml/models.ts index da6dcb289..693c813d7 100644 --- a/integration-tests/typescript-koa/src/generated/todo-lists.yaml/models.ts +++ b/integration-tests/typescript-koa/src/generated/todo-lists.yaml/models.ts @@ -8,7 +8,7 @@ export type t_Error = { } export type t_TodoList = { - created: string + created: Date id: string incompleteItemCount: number name: string diff --git a/integration-tests/typescript-koa/src/generated/todo-lists.yaml/schemas.ts b/integration-tests/typescript-koa/src/generated/todo-lists.yaml/schemas.ts index 3c99ec6ce..b276b1a7d 100644 --- a/integration-tests/typescript-koa/src/generated/todo-lists.yaml/schemas.ts +++ b/integration-tests/typescript-koa/src/generated/todo-lists.yaml/schemas.ts @@ -11,7 +11,10 @@ export const s_TodoList = z.object({ name: z.string(), totalItemCount: z.coerce.number(), incompleteItemCount: z.coerce.number(), - created: z.string().datetime({ offset: true }), + created: z + .string() + .datetime({ offset: true }) + .transform((it) => new Date(it)), updated: z.string().datetime({ offset: true }), }) diff --git a/packages/openapi-code-generator/src/core/input.ts b/packages/openapi-code-generator/src/core/input.ts index 7aadbebec..85f1a1a91 100644 --- a/packages/openapi-code-generator/src/core/input.ts +++ b/packages/openapi-code-generator/src/core/input.ts @@ -368,6 +368,7 @@ function normalizeSchemaObject( const base: IRModelBase = { nullable: schemaObject.nullable || false, readOnly: schemaObject.readOnly || false, + "x-alpha-transform": schemaObject["x-alpha-transform"], } switch (schemaObject.type) { diff --git a/packages/openapi-code-generator/src/core/openapi-types-normalized.ts b/packages/openapi-code-generator/src/core/openapi-types-normalized.ts index da549f446..f583423c0 100644 --- a/packages/openapi-code-generator/src/core/openapi-types-normalized.ts +++ b/packages/openapi-code-generator/src/core/openapi-types-normalized.ts @@ -8,6 +8,13 @@ export interface IRModelBase { // Note: meaningless for top level objects, maybe we can exclude these somehow in that case nullable: boolean /* false */ readOnly: boolean /* false */ + + "x-alpha-transform"?: + | { + fn?: string | undefined + type?: string | undefined + } + | undefined } export type IRModelNumericFormat = "int32" | "int64" | "float" | "double" diff --git a/packages/openapi-code-generator/src/core/openapi-types.ts b/packages/openapi-code-generator/src/core/openapi-types.ts index bd4cef0ff..4f9ad16b8 100644 --- a/packages/openapi-code-generator/src/core/openapi-types.ts +++ b/packages/openapi-code-generator/src/core/openapi-types.ts @@ -248,6 +248,14 @@ export interface Schema { externalDocs?: ExternalDocumentation | undefined deprecated?: boolean | undefined // xml?: XML | undefined + + // TODO: not yet supported by joi + "x-alpha-transform"?: + | { + fn?: string | undefined + type?: string | undefined + } + | undefined } export interface Discriminator { diff --git a/packages/openapi-code-generator/src/typescript/common/schema-builders/abstract-schema-builder.ts b/packages/openapi-code-generator/src/typescript/common/schema-builders/abstract-schema-builder.ts index 4c30f120e..2459e8fed 100644 --- a/packages/openapi-code-generator/src/typescript/common/schema-builders/abstract-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/common/schema-builders/abstract-schema-builder.ts @@ -163,7 +163,31 @@ export abstract class AbstractSchemaBuilder< if (parameter.required) { model.required.push(parameter.name) } - model.properties[parameter.name] = parameter.schema + + // TODO: support $ref properly + if ( + parameter.in === "query" && + !isRef(parameter.schema) && + parameter.schema.type === "array" + ) { + model.properties[parameter.name] = { + type: "object", + additionalProperties: false, + properties: {}, + readOnly: false, + allOf: [], + nullable: false, + oneOf: [], + required: [], + anyOf: [parameter.schema, parameter.schema.items], + "x-alpha-transform": { + fn: ((it: unknown) => + Array.isArray(it) || it === undefined ? it : [it]).toString(), + }, + } + } else { + model.properties[parameter.name] = parameter.schema + } } return this.fromModel(model, true, true) @@ -304,6 +328,10 @@ export abstract class AbstractSchemaBuilder< result = required ? this.required(result) : this.optional(result) + if (model["x-alpha-transform"]?.fn) { + result = this.transform(result, model["x-alpha-transform"]?.fn) + } + return result } @@ -327,6 +355,11 @@ export abstract class AbstractSchemaBuilder< protected abstract union(schemas: string[]): string + protected abstract transform( + schema: string, + transformation: string | ((it: unknown) => unknown), + ): string + protected abstract nullable(schema: string): string protected abstract optional(schema: string): string diff --git a/packages/openapi-code-generator/src/typescript/common/schema-builders/joi-schema-builder.ts b/packages/openapi-code-generator/src/typescript/common/schema-builders/joi-schema-builder.ts index 837086ef1..eea526797 100644 --- a/packages/openapi-code-generator/src/typescript/common/schema-builders/joi-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/common/schema-builders/joi-schema-builder.ts @@ -108,6 +108,14 @@ export class JoiBuilder extends AbstractSchemaBuilder< .join(".") } + protected transform( + schema: string, + transformation: string | ((it: unknown) => unknown), + ) { + // TODO: is it possible to do arbitrary transformations with `joi`? + return schema + } + protected nullable(schema: string): string { return [schema, "allow(null)"].join(".") } diff --git a/packages/openapi-code-generator/src/typescript/common/schema-builders/zod-schema-builder.ts b/packages/openapi-code-generator/src/typescript/common/schema-builders/zod-schema-builder.ts index 3876b3208..7f161c5bf 100644 --- a/packages/openapi-code-generator/src/typescript/common/schema-builders/zod-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/common/schema-builders/zod-schema-builder.ts @@ -133,6 +133,15 @@ export class ZodBuilder extends AbstractSchemaBuilder< .join(".") } + protected transform( + schema: string, + transformation: string | ((it: unknown) => unknown), + ) { + return [schema, `transform(${transformation.toString()})`] + .filter(isDefined) + .join(".") + } + protected nullable(schema: string): string { return [schema, "nullable()"].filter(isDefined).join(".") } diff --git a/packages/openapi-code-generator/src/typescript/common/type-builder.ts b/packages/openapi-code-generator/src/typescript/common/type-builder.ts index 41b3627a8..169cf0de5 100644 --- a/packages/openapi-code-generator/src/typescript/common/type-builder.ts +++ b/packages/openapi-code-generator/src/typescript/common/type-builder.ts @@ -145,7 +145,9 @@ export class TypeBuilder implements ICompilable { result.push(...schemaObject.anyOf.flatMap(this.schemaObjectToTypes)) } - if (result.length === 0) { + if (schemaObject["x-alpha-transform"]?.type) { + result.push(schemaObject["x-alpha-transform"]?.type) + } else if (result.length === 0) { switch (schemaObject.type) { case "array": { result.push(array(this.schemaObjectToType(schemaObject.items))) diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts index 701a9cb87..ff290fc54 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts @@ -25,14 +25,14 @@ import { function reduceParamsToOpenApiSchema(parameters: IRParameter[]): IRModelObject { return parameters.reduce( - (acc, parameter) => { - acc.properties[parameter.name] = parameter.schema + (model, parameter) => { + model.properties[parameter.name] = parameter.schema if (parameter.required) { - acc.required.push(parameter.name) + model.required.push(parameter.name) } - return acc + return model }, { type: "object",