New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zod-openapi

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zod-openapi - npm Package Compare versions

Comparing version 2.17.0-beta.1 to 2.17.0-beta.2

lib-types/extendZodTypes.d.ts

2

lib-types/extend.d.ts

@@ -1,1 +0,1 @@

export type * from './extendZod';
export * from './extendZodTypes';

@@ -1,76 +0,3 @@

import type { ZodDate, ZodObject, ZodTypeAny, z } from 'zod';
import type { CreationType } from './create/components';
import type { oas30, oas31 } from './openapi3-ts/dist';
type SchemaObject = oas30.SchemaObject & oas31.SchemaObject;
/**
* zod-openapi metadata
*/
interface ZodOpenApiMetadata<T extends ZodTypeAny, TInferred = z.input<T> | z.output<T>> extends SchemaObject {
example?: TInferred;
examples?: [TInferred, ...TInferred[]];
default?: T extends ZodDate ? string : TInferred;
/**
* Used to set the output of a ZodUnion to be `oneOf` instead of `allOf`
*/
unionOneOf?: boolean;
/**
* Used to output this Zod Schema in the components schemas section. Any usage of this Zod Schema will then be transformed into a $ref.
*/
ref?: string;
/**
* Used when you are manually adding a Zod Schema to the components section. This controls whether this should be rendered as request (`input`) or response (`output`). Defaults to `output`
*/
refType?: CreationType;
/**
* Used to set the created type of an effect.
*/
effectType?: CreationType | (z.input<T> extends z.output<T> ? z.output<T> extends z.input<T> ? 'same' : never : never);
/**
* Used to set metadata for a parameter, request header or cookie
*/
param?: Partial<oas31.ParameterObject> & {
example?: TInferred;
examples?: Record<string, (oas31.ExampleObject & {
value: TInferred;
}) | oas31.ReferenceObject>;
/**
* Used to output this Zod Schema in the components parameters section. Any usage of this Zod Schema will then be transformed into a $ref.
*/
ref?: string;
};
/**
* Used to set data for a response header
*/
header?: Partial<oas31.HeaderObject & oas30.HeaderObject> & {
/**
* Used to output this Zod Schema in the components headers section. Any usage of this Zod Schema will then be transformed into a $ref.
*/
ref?: string;
};
/**
* Used to override the generated type. If this is provided no metadata will be generated.
*/
type?: SchemaObject['type'];
}
interface ZodOpenApiExtendMetadata {
extends: ZodObject<any, any, any, any, any>;
}
declare module 'zod' {
interface ZodType {
/**
* Add OpenAPI metadata to a Zod Type
*/
openapi<T extends ZodTypeAny>(this: T, metadata: ZodOpenApiMetadata<T>): T;
}
interface ZodTypeDef {
/**
* OpenAPI metadata
*/
openapi?: ZodOpenApiMetadata<ZodTypeAny>;
}
interface ZodObjectDef {
extendMetadata?: ZodOpenApiExtendMetadata;
}
}
import type { z } from 'zod';
import './extendZodTypes';
export declare function extendZodWithOpenApi(zod: typeof z): void;
export {};
{
"name": "zod-openapi",
"version": "2.17.0-beta.1",
"version": "2.17.0-beta.2",
"description": "Convert Zod Schemas to OpenAPI v3.x documentation",

@@ -43,2 +43,10 @@ "keywords": [

"types": "./lib-types/index.d.ts",
"typesVersions": {
"*": {
"*": [
"lib-types/index.d.ts",
"lib-types/extend.d.ts"
]
}
},
"files": [

@@ -45,0 +53,0 @@ "lib*/**/*.d.ts",

@@ -36,4 +36,2 @@ <p align="center">

#### Automatic
```ts

@@ -40,0 +38,0 @@ import 'zod-openapi/extend';

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc