Skip to content

JSONFoundation 1.3.0

Choose a tag to compare

@odrobnik odrobnik released this 27 Jun 07:30
80019eb

Build out the JSON-RPC 2.0 envelope — additive, pure (Foundation-only, zero-dep), no transport or concurrency, no breaking changes.

JSONRPCMessage

  • Accessors method / params / result / error and predicates isRequest / isNotification / isResponse / isErrorResponse / isReply, so consumers stop hand-rolling shape classification.
  • replyOutcome: Result<JSONDictionary?, JSONRPCError>? — the shape a request/response correlator wants.
  • Encoding as the symmetric inverse of decodeMessages: encoded() / encodedString() / encodeBatch(_:).
  • Equatable + Hashable, validate(), and a compact CustomStringConvertible.

JSONRPCID: ExpressibleBy{Integer,String}Literal, intValue / stringValue, description.

JSONRPCError: consolidated into its own file; added serverError(code:message:data:) and isReservedCode / isServerError range checks.

Full Changelog: 1.2.0...1.3.0