Skip to content

JSONFoundation 2.5.0

Latest

Choose a tag to compare

@odrobnik odrobnik released this 03 Jul 05:23
4a147fb

The polish release: a full-project review (82 verified findings) applied end to end — bug fixes across the envelope, schema, macro, and transports, a proper import JSONRPC umbrella module, rewritten documentation, and a test suite that grew from 60 to 137 tests. Everything is additive or deprecation-mediated; existing code keeps compiling.

Bug fixes

  • JSON-RPC: a response with a nil result now encodes spec-valid "result": null (and round-trips through this library's own decoder); batches are no longer truncated to their first message by the transports; a malformed batch element surfaces its real decoding error; isBatchPayload tolerates a UTF-8 BOM.
  • JSONSchema: withoutRequired and addingAdditionalPropertiesRestrictionToObjects no longer drop object titles.
  • @Schema macro: non-ASCII text (umlauts, emoji) survives into generated descriptions; a CodingKeys enum is honored at any access level (previously private only), so schema names match wire keys.
  • JSONValue: JSON 0/1 parsed via JSONSerialization no longer misclassify as booleans (NSNumber→Bool bridging, on both Darwin and Linux).
  • TCP: a write to a hung-up peer can no longer kill the host process with SIGPIPE, and mid-stream write failures report a dedicated sendFailed error.
  • Stdio: executable PATH resolution is Windows-aware (; separators, case-insensitive Path, .exe/.cmd/.bat).

import JSONRPC now works

The batteries-included JSONRPC product is backed by a real umbrella module re-exporting the peer, codecs, and the stdio/TCP/SSE transports — no more product/module mismatch.

Renames (old names deprecated, still compiling)

  • MCPJSONCodingJSONCoding
  • StdioMessageTransportStdioTransport
  • JSONValue.valueJSONValue.jsonObject (now public)

Other improvements

  • JSONRPCPeer.sendRequest honors task cancellation; peer/transport contracts (notification ordering, send-after-close) are documented.
  • JSONValue gains uintValue; JSONRPCID gains debugDescription; SSE comment messages round-trip through LosslessStringConvertible.
  • README rewritten around all nine products with runtime examples and Subprocess-trait instructions; doc comments across the previously undocumented public surface; .spi.yml for hosted DocC.
  • CI now builds and tests the Subprocess trait, pins SwiftLint and toolchain actions, and the whole repo is swiftformat/swiftlint --strict clean.

Full Changelog: 2.4.0...2.5.0