next-openapi-gen 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -162,6 +162,28 @@ For more adoption patterns, see
162
162
 
163
163
  When you target modern OpenAPI output, the Zod path can also split request and response component refs when a supported Zod 4 schema emits different input and output JSON Schema shapes, while the TypeScript path can use selective checker fallback for mapped, conditional, template-literal, and import-based named types.
164
164
 
165
+ ### Add OpenAPI metadata directly in Zod schemas
166
+
167
+ Use `.describe()` for a quick description, or Zod v4's `.meta()` to attach `description`, `examples`, `example`, `deprecated`, `title`, and custom `x-*` extensions without any JSDoc:
168
+
169
+ ```ts
170
+ // .describe() → description field
171
+ z.string().describe("ISO 639-1 language code");
172
+ // → { type: "string", description: "ISO 639-1 language code" }
173
+
174
+ // .meta() → description + examples (and any other OpenAPI key)
175
+ z.number()
176
+ .int()
177
+ .positive()
178
+ .meta({
179
+ description: "PIM ID of the slider",
180
+ examples: [42, 1337],
181
+ });
182
+ // → { type: "integer", exclusiveMinimum: 0, description: "PIM ID of the slider", examples: [42, 1337] }
183
+ ```
184
+
185
+ Both work inside `z.object({...})` properties, in drizzle-zod override callbacks, and at the top level of named schemas. See [docs/zod4-support-matrix.md](./docs/zod4-support-matrix.md) for the full supported metadata surface.
186
+
165
187
  ### Generate docs from Drizzle schemas
166
188
 
167
189
  `next-openapi-gen` works well with `drizzle-zod`, so your database schema, validation, and API docs can share the same source of truth.