Skip to content

Commit 00d8f01

Browse files
committed
docs: annotation
1 parent e140821 commit 00d8f01

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/server.schema.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,16 @@ const normalizeInputSchema = (inputSchema: unknown): z.ZodTypeAny | unknown => {
149149
* Defaults target to JSON Schema 2020-12 and generates the INPUT schema (for args).
150150
*
151151
* @param schema - Zod schema
152-
* @param params - Optional parameters
153-
* @param params.target - JSON Schema version to generate. Defaults to "draft-2020-12".
154-
* @param params.io - Whether to generate the INPUT or OUTPUT schema. Defaults to "input".
155-
* @param params.unrepresentable - What to do with unrepresentable values. Defaults to "any".
156-
* @param params.params - Additional parameters to pass to toJSONSchema.
152+
* @param options - Optional parameters for `toJSONSchema`.
153+
* @param options.target - JSON Schema version to generate. Defaults to "draft-2020-12".
154+
* @param options.io - Whether to generate the INPUT or OUTPUT schema. Defaults to "input".
155+
* @param options.unrepresentable - What to do with unrepresentable values. Defaults to "any".
156+
* @param options.remainingOptions - Additional options to pass to toJSONSchema.
157157
*/
158158
const zodToJsonSchema = (
159159
schema: unknown,
160-
{ target = 'draft-2020-12', io = 'input', unrepresentable = 'any', ...params }:
161-
{ target?: string; io?: 'input' | 'output'; unrepresentable?: 'throw' | 'any', params?: Record<string, unknown> } = {}
160+
{ target = 'draft-2020-12', io = 'input', unrepresentable = 'any', ...remainingOptions }:
161+
{ target?: string; io?: 'input' | 'output'; unrepresentable?: 'throw' | 'any', remainingOptions?: Record<string, unknown> } = {}
162162
): unknown => {
163163
if (!isZodSchema(schema)) {
164164
return undefined;
@@ -169,7 +169,7 @@ const zodToJsonSchema = (
169169
target,
170170
io,
171171
unrepresentable,
172-
...params
172+
...remainingOptions
173173
});
174174
} catch {}
175175

0 commit comments

Comments
 (0)