zopia 0.5.0 โ 0.5.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
CHANGED
|
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.5.1] - 2026-09-30
|
|
11
|
+
|
|
12
|
+
### ๐ Fixed
|
|
13
|
+
- ๐ **Duplicate `.int()` in generated Zod schemas for `int32` and `int64`
|
|
14
|
+
formats (#4).** Integer properties carrying an integer format emitted
|
|
15
|
+
`z.number().int().int()...` โ the `integer` type already appends `.int()`
|
|
16
|
+
and the format branch appended it again. Now every combination
|
|
17
|
+
(`integer`/`number` ร `int32`/`int64`/`uint32`/`uint64`) emits exactly one
|
|
18
|
+
`.int()`, with bounds (`int32` โ `-2147483648...2147483647`,
|
|
19
|
+
`uint32` โ `0...4294967295`) and `.nonnegative()` for the unsigned formats
|
|
20
|
+
unchanged. Runtime validation, warning codes, and reverse-conversion
|
|
21
|
+
overlays are untouched; covered by new unit and end-to-end regression
|
|
22
|
+
tests that assert the emitted code (not just parse behavior).
|
|
23
|
+
|
|
10
24
|
## [0.5.0] - 2026-09-29
|
|
11
25
|
|
|
12
26
|
### โจ Added
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
[](https://bun.sh/)
|
|
14
14
|
[](https://vitest.dev/)
|
|
15
15
|
|
|
16
|
-
โ
**Status โ Phase 3 complete ยท v0.5.
|
|
16
|
+
โ
**Status โ Phase 3 complete ยท v0.5.1 released**
|
|
17
17
|
|
|
18
18
|
</div>
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -684,11 +684,17 @@ function jsonSchemaToZodInternal(input: JsonSchema | string, options: JsonSchema
|
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
686
|
if ((node.format === 'int32' || node.format === 'int64') && (node.type === 'integer' || node.type === 'number')) {
|
|
687
|
-
|
|
688
|
-
|
|
687
|
+
// `integer` schemas already carry .int() from the type switch above โ appending it again
|
|
688
|
+
// duplicated the call in generated code (issue #4); only `number` schemas need it added here.
|
|
689
|
+
const alreadyInteger = node.type === 'integer';
|
|
690
|
+
const integer = alreadyInteger ? result.schema : (result.schema as any).int();
|
|
691
|
+
const code = alreadyInteger ? result.code : `${result.code}.int()`;
|
|
692
|
+
result = node.format === 'int32' ? { schema: (integer as any).min(-2147483648).max(2147483647), code: `${code}.min(-2147483648).max(2147483647)` } : { schema: integer, code };
|
|
689
693
|
}
|
|
690
694
|
if ((node.format === 'uint32' || node.format === 'uint64') && (node.type === 'integer' || node.type === 'number')) {
|
|
691
|
-
const
|
|
695
|
+
const alreadyInteger = node.type === 'integer';
|
|
696
|
+
const integer = alreadyInteger ? (result.schema as any).nonnegative() : (result.schema as any).int().nonnegative();
|
|
697
|
+
const code = alreadyInteger ? `${result.code}.nonnegative()` : `${result.code}.int().nonnegative()`;
|
|
692
698
|
result = node.format === 'uint32' ? { schema: integer.max(4294967295), code: `${code}.max(4294967295)` } : { schema: integer, code };
|
|
693
699
|
}
|
|
694
700
|
if (node.format && node.type === 'string') {
|
|
@@ -16,7 +16,7 @@ export const ZOPIA_MANIFEST_SCHEMA = 'zopia:manifest@1' as const;
|
|
|
16
16
|
export const ZOPIA_MANIFEST_FILE = '.zopia-manifest.json' as const;
|
|
17
17
|
|
|
18
18
|
/** Package version recorded by the current manifest writer. */
|
|
19
|
-
export const ZOPIA_VERSION = '0.5.
|
|
19
|
+
export const ZOPIA_VERSION = '0.5.1' as const;
|
|
20
20
|
|
|
21
21
|
/** Supported source dialect labels stored in a manifest. */
|
|
22
22
|
export type ZopiaManifestSourceKind = 'swagger-2.0' | 'openapi-3.0' | 'openapi-3.1';
|