@gabrielbryk/json-schema-to-zod 2.9.0 → 2.10.1
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/CHANGELOG.md +12 -0
- package/dist/cjs/core/emitZod.js +21 -5
- package/dist/cjs/generators/generateBundle.js +213 -58
- package/dist/cjs/parsers/parseAllOf.js +12 -6
- package/dist/cjs/parsers/parseBoolean.js +1 -3
- package/dist/cjs/parsers/parseIfThenElse.js +2 -2
- package/dist/cjs/parsers/parseNull.js +1 -3
- package/dist/cjs/parsers/parseObject.js +11 -3
- package/dist/cjs/parsers/parseSchema.js +18 -6
- package/dist/cjs/parsers/parseString.js +1 -1
- package/dist/cjs/utils/buildRefRegistry.js +1 -1
- package/dist/cjs/utils/omit.js +3 -2
- package/dist/esm/core/emitZod.js +21 -5
- package/dist/esm/generators/generateBundle.js +213 -58
- package/dist/esm/parsers/parseAllOf.js +12 -6
- package/dist/esm/parsers/parseBoolean.js +1 -3
- package/dist/esm/parsers/parseIfThenElse.js +2 -2
- package/dist/esm/parsers/parseNull.js +1 -3
- package/dist/esm/parsers/parseObject.js +11 -3
- package/dist/esm/parsers/parseSchema.js +18 -6
- package/dist/esm/parsers/parseString.js +1 -1
- package/dist/esm/utils/buildRefRegistry.js +1 -1
- package/dist/esm/utils/omit.js +3 -2
- package/dist/types/Types.d.ts +6 -3
- package/dist/types/parsers/parseBoolean.d.ts +1 -4
- package/dist/types/parsers/parseNull.d.ts +1 -4
- package/dist/types/utils/buildRefRegistry.d.ts +2 -2
- package/eslint.config.js +1 -1
- package/package.json +1 -1
package/dist/esm/utils/omit.js
CHANGED
package/dist/types/Types.d.ts
CHANGED
|
@@ -6,6 +6,11 @@ export type JsonSchemaObject = {
|
|
|
6
6
|
type?: string | string[];
|
|
7
7
|
$id?: string;
|
|
8
8
|
$ref?: string;
|
|
9
|
+
$anchor?: string;
|
|
10
|
+
$dynamicRef?: string;
|
|
11
|
+
$dynamicAnchor?: string;
|
|
12
|
+
$recursiveRef?: string;
|
|
13
|
+
$recursiveAnchor?: boolean;
|
|
9
14
|
$defs?: Record<string, JsonSchema>;
|
|
10
15
|
definitions?: Record<string, JsonSchema>;
|
|
11
16
|
title?: string;
|
|
@@ -53,9 +58,7 @@ export type JsonSchemaObject = {
|
|
|
53
58
|
errorMessage?: {
|
|
54
59
|
[key: string]: string | undefined;
|
|
55
60
|
};
|
|
56
|
-
} &
|
|
57
|
-
[key: string]: any;
|
|
58
|
-
};
|
|
61
|
+
} & Record<string, unknown>;
|
|
59
62
|
export type ParserSelector = (schema: JsonSchemaObject, refs: Refs) => string;
|
|
60
63
|
export type ParserOverride = (schema: JsonSchemaObject, refs: Refs) => string | void;
|
|
61
64
|
export type Options = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonSchema
|
|
1
|
+
import { JsonSchema } from "../Types.js";
|
|
2
2
|
export type RefRegistryEntry = {
|
|
3
3
|
schema: JsonSchema;
|
|
4
4
|
path: (string | number)[];
|
|
@@ -6,7 +6,7 @@ export type RefRegistryEntry = {
|
|
|
6
6
|
dynamic?: boolean;
|
|
7
7
|
anchor?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const buildRefRegistry: (schema: JsonSchema, rootBaseUri?: string
|
|
9
|
+
export declare const buildRefRegistry: (schema: JsonSchema, rootBaseUri?: string) => {
|
|
10
10
|
registry: Map<string, RefRegistryEntry>;
|
|
11
11
|
rootBaseUri: string;
|
|
12
12
|
};
|
package/eslint.config.js
CHANGED