You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package provides a json encoder and decoder in pure Swift (without the use of Foundation or any other dependency).
8
-
The implementation is [RFC8259](https://tools.ietf.org/html/rfc8259)complient. It offers a significant performance improvement over the Foundation implementation on Linux.
8
+
The implementation is [RFC8259](https://tools.ietf.org/html/rfc8259)compliant. It offers a significant performance improvement compared to the Foundation implementation on Linux.
9
9
10
-
If you like the idea of using pure Swift without any dependencies you might also like my reimplementation of Base64 in pure Swift: [`swift-base64-kit`](https://github.com/fabianfett/swift-base64-kit)
10
+
If you like the idea of using pure Swift without any dependencies, you might also like my reimplementation of Base64 in pure Swift: [`swift-base64-kit`](https://github.com/fabianfett/swift-base64-kit)
11
11
12
-
‼️ **NOTE:** This is in a very early stage of development. Please take into account that the API might change while in prerelease.
12
+
‼️ **NOTE:** This is at a very early stage of development. Please take into account that the API might change while in pre-release.
13
13
14
14
## Goals
15
15
16
-
-[x]Does not use Foundation at all
17
-
-[x]Does not use `unsafe` Swift syntax
18
-
-[x]No external dependencies other than the Swift STL
19
-
-[x]Faster than Foundation implementation
16
+
-[x]does not use Foundation at all
17
+
-[x]does not use `unsafe` Swift syntax
18
+
-[x]no external dependencies other than the Swift STL
19
+
-[x]faster than Foundation implementation
20
20
21
21
#### Currently not supported
22
22
23
23
- custom encoder and decoder for [`Data` and `Date`](#what-about-date-and-data)
24
24
- parsing/decoding of [UTF-16 and UTF-32 encoded json](#utf-16-and-utf-32)
25
-
-transform CodingKeys to camelCase or snake_case (I want to look into this)
25
+
-transforming `CodingKey`s to camelCase or snake_case (I want to look into this)
26
26
27
27
#### Alternatives
28
28
29
-
-[IkigaJSON](https://github.com/autimatisering/IkigaJSON)Super fast encoding and decoding especially for server side Swift code. Depends on `SwiftNIO`.
29
+
-[IkigaJSON](https://github.com/autimatisering/IkigaJSON)super fast encoding and decoding especially for server side Swift code. Depends on `SwiftNIO`.
Date and Data are special cases for encoding and decoding. They do have default implementations that are kind off special:
98
+
Date and Data are particular cases for encoding and decoding. They do have default implementations that are kind off special:
99
99
100
100
- Date will be encoded as a float
101
101
@@ -105,8 +105,8 @@ Date and Data are special cases for encoding and decoding. They do have default
105
105
106
106
Example: `0, 1, 2, 3, 255` will be encoded as: `[0, 1, 2, 3, 255]`
107
107
108
-
Yes that is the default implementation. Only Apple knows why it is not [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) and [Base64](https://en.wikipedia.org/wiki/Base64). 🙃
109
-
Because I don't want to link against Foundation it is not possible to implement default encoding and decoding strategies for `Date` and `Data`as the Foundation implementation does. That's why, if you want to use another encoding/decoding strategy than the default you need to overwrite `encode(to: Encoder)` and `init(from: Decoder)`.
108
+
Yes, that is the default implementation. Only Apple knows why it is not [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) and [Base64](https://en.wikipedia.org/wiki/Base64). 🙃
109
+
Since I don't want to link against Foundation, it is not possible to implement default encoding and decoding strategies for `Date` and `Data`like the Foundation implementation does. That's why, if you want to use another encoding/decoding strategy than the default, you need to overwrite `encode(to: Encoder)` and `init(from: Decoder)`.
Please feel welcome and encouraged to contribute to `pure-swift-json`. This is a very young endeavour and help is always welcome.
163
163
164
-
If you've found a bug, have a suggestion or need help getting started, please open an Issue or a PR. If you use this package, I'd be grateful for sharing your experience.
164
+
If you've found a bug, have a suggestion, or need help getting started, please open an Issue or a PR. If you use this package, I'd be grateful for sharing your experience.
0 commit comments