fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

GUID zod plugin implementation

+69
+11
packages/openapi-ts-tests/zod/v4/__snapshots__/3.1.x/mini/string-with-guid-format/zod.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as z from 'zod/mini'; 4 + 5 + export const zGetFooData = z.object({ 6 + body: z.optional(z.never()), 7 + path: z.object({ 8 + guidId: z.guid() 9 + }), 10 + query: z.optional(z.never()) 11 + });
+11
packages/openapi-ts-tests/zod/v4/__snapshots__/3.1.x/v3/string-with-guid-format/zod.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import { z } from 'zod/v3'; 4 + 5 + export const zGetFooData = z.object({ 6 + body: z.never().optional(), 7 + path: z.object({ 8 + guidId: z.string() 9 + }), 10 + query: z.never().optional() 11 + });
+11
packages/openapi-ts-tests/zod/v4/__snapshots__/3.1.x/v4/string-with-guid-format/zod.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as z from 'zod'; 4 + 5 + export const zGetFooData = z.object({ 6 + body: z.never().optional(), 7 + path: z.object({ 8 + guidId: z.guid() 9 + }), 10 + query: z.never().optional() 11 + });
+13
packages/openapi-ts-tests/zod/v4/test/formats.test.ts
··· 46 46 }), 47 47 description: 'generates anyOf string and binary string', 48 48 }, 49 + { 50 + config: createConfig({ 51 + input: 'string-with-guid-format.yaml', 52 + output: 'string-with-guid-format', 53 + plugins: [ 54 + { 55 + compatibilityVersion: zodVersion.compatibilityVersion, 56 + name: 'zod', 57 + }, 58 + ], 59 + }), 60 + description: 'handles string guid format', 61 + }, 49 62 ]; 50 63 51 64 it.each(scenarios)('$description', async ({ config }) => {
+1
packages/openapi-ts/src/plugins/zod/constants.ts
··· 20 20 globalRegistry: 'globalRegistry', 21 21 gt: 'gt', 22 22 gte: 'gte', 23 + guid: 'guid', 23 24 infer: 'infer', 24 25 int: 'int', 25 26 intersection: 'intersection',
+2
packages/openapi-ts/src/plugins/zod/mini/toAst/string.ts
··· 44 44 return $(z).attr(identifiers.iso).attr(identifiers.time).call(); 45 45 case 'uri': 46 46 return $(z).attr(identifiers.url).call(); 47 + case 'guid': 48 + return $(z).attr(identifiers.guid).call(); 47 49 case 'uuid': 48 50 return $(z).attr(identifiers.uuid).call(); 49 51 }
+2
packages/openapi-ts/src/plugins/zod/v4/toAst/string.ts
··· 44 44 return $(z).attr(identifiers.iso).attr(identifiers.time).call(); 45 45 case 'uri': 46 46 return $(z).attr(identifiers.url).call(); 47 + case 'guid': 48 + return $(z).attr(identifiers.guid).call(); 47 49 case 'uuid': 48 50 return $(z).attr(identifiers.uuid).call(); 49 51 }
+18
specs/3.1.x/string-with-guid-format.yaml
··· 1 + openapi: 3.1.1 2 + info: 3 + title: OpenAPI 3.1.1 string with GUID format example 4 + version: '1' 5 + paths: 6 + /foo/{guidId}: 7 + get: 8 + operationId: getFoo 9 + parameters: 10 + - name: guidId 11 + in: path 12 + required: true 13 + schema: 14 + type: string 15 + format: guid 16 + responses: 17 + '200': 18 + description: OK