tomlokhorst / Statham

Swift library for decoding JSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Statham


Statham is a library for dealing with JSON in Swift, it provides the ValueOrDecodingError<Wrapped> type.

Example

struct Inbox: Decodable {
  let items: [ValueOrDecodingError<Item>] 
}

Using this structure, if one of the items can't be decoded, the others still will be decoded.

About the previous version 1

Version 2.0 of this library is a competely different thing than the 1.0 version of Statham. The previous version was used for a custom Json decoder code generator, but as of Swift 4 with Decodable, this code generator is no longer needed.

Read more about version 1 of Statham.

Releases

  • 2.2.0 - 2021-01-19 - Add .value setter on ValueOrDecodingError type
  • 2.1.0 - 2019-06-10 - Add Indirect type, to deal with cycles in JSON structs/enums
  • 2.0.0 - 2018-08-21 - Replaced previous library with ValueOrJsonError

Licence & Credits

Statham is written by Tom Lokhorst and available under the MIT license, so feel free to use it in commercial and non-commercial projects.

About

Swift library for decoding JSON

License:MIT License


Languages

Language:Swift 79.4%Language:Ruby 20.6%