Skip to content

JSONFoundation 2.0.0

Choose a tag to compare

@odrobnik odrobnik released this 27 Jun 07:30
4928be5

Broaden JSON-RPC params / result to JSONValue — spec-complete. Source-breaking (a 2.0 change).

Request/notification params and response result are now JSONValue? (object, array, primitive, or null) rather than object-only JSONDictionary?. The decoder accepts any JSON value, so a null / non-object result no longer fails to decode — required for peers like ACP (e.g. fs/write_text_filenull).

JSONValue already conforms to the JSON literal protocols, so dictionary-literal construction (params: ["k": .string("v")]) and subscript access (params?["k"]) keep working unchanged; only sites passing a JSONDictionary variable now wrap it in .object(...).

19 tests (incl. null / primitive / array); swiftlint --strict clean.

Full Changelog: 1.3.0...2.0.0