From 2438feab534563bbe3d3915e5ae3c5e5aeb7dba0 Mon Sep 17 00:00:00 2001 From: Sacramentix <35272156+Sacramentix@users.noreply.github.com> Date: Wed, 31 Jan 2024 18:27:30 +0100 Subject: [PATCH] add autocompletion for media type --- src/openapi-registry.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openapi-registry.ts b/src/openapi-registry.ts index 0c872f2..debb9b6 100644 --- a/src/openapi-registry.ts +++ b/src/openapi-registry.ts @@ -77,9 +77,10 @@ export interface ZodMediaTypeObject { encoding?: EncodingObject; } -export interface ZodContentObject { - [mediaType: string]: ZodMediaTypeObject; -} +// Provide autocompletion on media type with most common one without restricting to anything. +export type ZodMediaType = 'application/json' | 'text/html' | 'text/plain' | 'application/xml' | string & {}; + +export type ZodContentObject = Partial>; export interface ZodRequestBody { description?: string;