Repository navigation
Swift-JSON 1.1.0
Swift-JSON 1.1.0 adds scoped access, exact persistence and Apple mobile support to the strict JSON model introduced in 1.0.
What changes
- Scoped typed reads: chain throwing String, JSONKey and Int brackets; distinguish absence from null; convert numbers with explicit fidelity; decode models under one cumulative meter. Cursors are synchronous and non-Sendable, invalidate on scope exit and release their root/source references.
- Native Codable conveniences: encode models directly into JSON values and decode them using the existing native strategies, without a Foundation serialization intermediate.
- Exact versioned persistence: JSONCodablePayload uses a fixed Version 1 envelope containing strict Base64 of a complete UTF-8 JSON document. It preserves exact decimals, decoded scalars, insertion order and admitted numeric lexemes. The qualified SwiftData example remains outside the core products and demonstrates disk reopening across three exited processes.
- Wide-object indexing: private exact-confirmed metadata accelerates wide-object construction and lookup, retains ordered members, and recognizes duplicates at the second key before its value. Growth, collisions and cancellation remain metered; small objects retain their scalar path.
- Apple platforms: macOS 27 and iOS/iPadOS 27 deployment minima, with corrected schema-resource packaging and SDK/simulator consumers.
- Correctness fixes: native ISO-8601 now includes calendar fields; strict Base64 rejects noncanonical unused padding bits; failed Base64 scratch is released from logical accounting without refunding work or terminal failures.
Compatibility and installation
Swift tools/compiler 6.4+, Swift language mode 6, and macOS or iOS/iPadOS 27+. Native qualification uses Apple Silicon with SDK 27.2. Four public products remain JSON, JSONSchema, JSONStreaming and JSONPatch; JSONRegexRuntime is private. Root package dependencies remain empty. Original code is Apache-2.0 with retained upstream notices.
.package(url: "https://github.com/ThorFuchs/Swift-JSON.git", from: "1.1.0")Existing exact decimal, decoded-scalar key/text, ordered-object equality, strict UTF-8, offline schema-plan, staged Patch and stream-completion contracts remain. The ISO-8601 calendar correction can require explicit application migration for previously written time-only data. Package versions, payload format versions and application/SwiftData schemas are separate; the persistence envelope does not silently convert older storage formats. See the API and migration contract.
Qualification and limitations
The exact tagged commit passed post-merge Native / native, Native / safety and Native / docs, and the existing Pages deployment. The matching source archive is clean-extracted: its Git-free build/debug/release tests pass, and the full native lane passes after actual public Git metadata supplies the ownership probes’ required commit identity. Archive source bytes remain unchanged. Qualification retains 175 test functions, 173 parameterized invocations, full ASAN, five TSAN cases, strict memory-safety compilation, all 49 cap probes, pinned independent suites, four DocC catalogues, 582 authored public symbols and 10 compiled README examples. Corpus policy exclusions are listed separately from evaluated successes; ordinary schema invalidity remains distinct from operational errors. The public JSON/JSONSchema consumer retains 20 explicitly rooted frozen cases; it does not establish MCP server conformance.
Both mobile SDKs and iPhone/iPad simulator public behavior and three-process disk persistence are qualified, with unchanged-source physical iPhone evidence. Physical iPad behavior, performance, memory and energy are deferred and unmeasured, under the explicit 1.1 qualification policy. Simulator data is not a physical-device measurement.
The unchanged 10% performance review trigger and accepted dispositions remain: the historical stream comparison is approximately +11.0%; the separate matched 1.1 comparison is +15.76%. Wide-object gains include documented small-workload and spare-capacity costs. These are measured tradeoffs, without a package-wide speedup or hard RSS guarantee. Logical retained bytes differ from process RSS, and arbitrary caller callbacks are outside owned instruction quotas. See the measured disposition. SIMD, independent-work parallel batches, E11 projection and E12 text-sequence framing remain deferred.
Assets and support
Install through the SwiftPM tag. The source archive carries its own file manifest; the DocC archive preserves native catalogue filenames. The qualification JSON and evidence archive identify the source, environment, commands, counts, exclusions and limitations. Verify downloads against SHA256SUMS. Maintainer-private handoff bundles, device identifiers and build/signing outputs are excluded from these assets.
Online documentation tracks qualified main; the attached DocC archive matches this tag exactly. Changelog · Support · Private security reporting.