Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
fix: add fallback for `type` field in `restTabState` schema (#4398)
Nivedin853500402325
diff --git a/packages/hoppscotch-common/src/services/persistence/validation-schemas/index.ts b/packages/hoppscotch-common/src/services/persistence/validation-schemas/index.tsindex a6e3887d5..9afdbac7d 100644--- a/packages/hoppscotch-common/src/services/persistence/validation-schemas/index.ts+++ b/packages/hoppscotch-common/src/services/persistence/validation-schemas/index.ts@@ -533,7 +533,7 @@ export const REST_TAB_STATE_SCHEMA = zz.object({// !Versioned entityrequest: entityReference(HoppRESTRequest),- type: z.literal("request"),+ type: z.literal("request").catch("request"),isDirty: z.boolean(),saveContext: z.optional(HoppRESTSaveContextSchema),response: z.optional(z.nullable(HoppRESTResponseSchema)),@@ -544,7 +544,7 @@ export const REST_TAB_STATE_SCHEMA = zcancelFunction: z.optional(z.function()),}),z.object({- type: z.literal("example-response"),+ type: z.literal("example-response").catch("example-response"),response: HoppRESTRequestResponse,saveContext: z.optional(HoppRESTSaveContextSchema),isDirty: z.boolean(),