Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.

Commit 7d5234a

Browse files
committed
chore: fix spell mistakes
1 parent 94a18b4 commit 7d5234a

File tree

18 files changed

+59
-34
lines changed

18 files changed

+59
-34
lines changed

.github/config/custom-words.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
json
2+
Github
3+
Codable
4+
DynamicCodableKit
5+
CocoaPods
6+
CocoaPod
7+
podspec
8+
SPM
9+
DocC
10+
Xcode
11+
XCFramework
12+
macOS
13+
tvOS
14+
watchOS
15+
submodule
16+
automagically
17+
casted
18+
url
19+
png
20+
lossy
21+
enum
22+
struct

.github/config/spellcheck.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ matrix:
55
d: en_US
66
dictionary:
77
encoding: utf-8
8+
wordlists:
9+
- .github/config/swift-custom.txt
10+
output: .build/dictionary/custom-words.dic
811
pipeline:
912
- pyspelling.filters.markdown:
1013
- pyspelling.filters.html:

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@
3737
* add dynamic JSON decoding with type identifiers ([63bab18](https://github.com/SwiftyLab/DynamicCodableKit/commit/63bab18f80d087d9538c17b4dd8189a7fef5a6c6))
3838
* add dynamic JSON decoding with type(s) parent coding key ([5c5bf0a](https://github.com/SwiftyLab/DynamicCodableKit/commit/5c5bf0a2567ad21927ea7a6a2cb4bfa1ab5ed2da))
3939
* add dynamic JSON decoding with user context provider ([8a61ceb](https://github.com/SwiftyLab/DynamicCodableKit/commit/8a61cebe6727159e88829e0b2f41bc521d3614ce))
40-
* add ingrore key with invalid data for parent coding key based dynamic decoding ([b9dc92f](https://github.com/SwiftyLab/DynamicCodableKit/commit/b9dc92f90ed10287e712aed09c192b8fea7ab54e))
40+
* add ignore key with invalid data for parent coding key based dynamic decoding ([b9dc92f](https://github.com/SwiftyLab/DynamicCodableKit/commit/b9dc92f90ed10287e712aed09c192b8fea7ab54e))
4141

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The data types, protocols, and property wrappers defined by **DynamicCodableKit*
4040
pod 'DynamicCodableKit'
4141
```
4242

43-
Optionally, you can also use the pre built XCFramework from the GitHub releases page by replacing `{version}` with the required version you want to use:
43+
Optionally, you can also use the pre-built XCFramework from the GitHub releases page by replacing `{version}` with the required version you want to use:
4444

4545
```ruby
4646
pod 'DynamicCodableKit', :http => 'https://github.com/SwiftyLab/DynamicCodableKit/releases/download/v{version}/DynamicCodableKit-{version}.xcframework.zip'
@@ -64,7 +64,7 @@ Once you have your Swift package set up, adding `DynamicCodableKit` as a depende
6464
.package(url: "https://github.com/SwiftyLab/DynamicCodableKit.git", from: "1.0.0"),
6565
```
6666

67-
Optionally, you can also use the pre built XCFramework from the GitHub releases page by replacing `{version}` and `{checksum}` with the required version and checksum of artifact you want to use:
67+
Optionally, you can also use the pre-built XCFramework from the GitHub releases page by replacing `{version}` and `{checksum}` with the required version and checksum of artifact you want to use:
6868

6969
```swift
7070
.binaryTarget(name: "DynamicCodableKit", url: "https://github.com/SwiftyLab/DynamicCodableKit/releases/download/v{version}/DynamicCodableKit-{version}.xcframework.zip", checksum: "{checksum}"),
@@ -117,7 +117,7 @@ See the full [documentation](https://swiftylab.github.io/DynamicCodableKit/docum
117117

118118
## Contributing
119119

120-
If you wish to contribute a change, suggest any improvementse,
120+
If you wish to contribute a change, suggest any improvements,
121121
please review our [contribution guide](CONTRIBUTING.md),
122122
check for open [issues](https://github.com/SwiftyLab/DynamicCodableKit/issues), if it is already being worked upon
123123
or open a [pull request](https://github.com/SwiftyLab/DynamicCodableKit/pulls).

Sources/DynamicCodableKit/DynamicCodableKit.docc/Extensions/DynamicDecodable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@DocumentationExtension(mergeBehavior: append)
55
}
66

7-
Provides `castAs` methods to customise dynamic casting to a provided type where provided type can be optional type or collection type as well. Default implementations are provided to work well with down casting, however custom types can provide their own casting behavior.
7+
Provides `castAs` methods to customize dynamic casting to a provided type where provided type can be optional type or collection type as well. Default implementations are provided to work well with down casting, however custom types can provide their own casting behavior.
88

99
For example, in <doc:TypeIdentifier>, to use `Set` of `Post` type instead of `Array`, a box type for `Post` type can be created that will confirm `Hashable`:
1010
```swift

Sources/DynamicCodableKit/DynamicCodableKit.docc/Guides/CollectionDecoding.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ These wrappers accept ``DynamicDecodingCollectionConfigurationProvider`` that pr
1010

1111
Implementation for all the configuration scenarios are provided with type aliases, depending upon following naming convention.
1212

13-
- Alases starting with `Strict..` indicate the if decoding fails then error is thrown.
14-
- Alases starting with `DefaultValue..` indicate that in the event of decoding fail, empty collection is used.
15-
- Alases starting with `Lossy..` provide safest decoding configuration. Each item in collection is decoded one by one, if the data for item is intact and valid item is added to collection, otherwise item is ignored.
13+
- Aliases starting with `Strict..` indicate the if decoding fails then error is thrown.
14+
- Aliases starting with `DefaultValue..` indicate that in the event of decoding fail, empty collection is used.
15+
- Aliases starting with `Lossy..` provide safest decoding configuration. Each item in collection is decoded one by one, if the data for item is intact and valid item is added to collection, otherwise item is ignored.
1616

1717
In the <doc:TypeIdentifier> topic, ``StrictDynamicDecodingArrayWrapper`` will throw error decoding following response, while, ``DefaultValueDynamicDecodingArrayWrapper`` will decode an empty array and ``LossyDynamicDecodingArrayWrapper`` will ignore first two items and only decode the last item.
1818
```json
@@ -33,7 +33,7 @@ In the <doc:TypeIdentifier> topic, ``StrictDynamicDecodingArrayWrapper`` will th
3333
"createdAt": "2021-07-23T09:36:38Z",
3434
"url": "https://a.url.com/to/a/video.mp4",
3535
"duration": 460,
36-
"thumbnail": "https://a.url.com/to/a/thmbnail.png"
36+
"thumbnail": "https://a.url.com/to/a/thumbnail.png"
3737
},
3838
{
3939
"id": "98765432-abcd-efab-0123-456789abcdef",
@@ -43,7 +43,7 @@ In the <doc:TypeIdentifier> topic, ``StrictDynamicDecodingArrayWrapper`` will th
4343
"createdAt": "2021-07-23T09:36:38Z",
4444
"url": "https://a.url.com/to/a/video.mp4",
4545
"duration": 460,
46-
"thumbnail": "https://a.url.com/to/a/thmbnail.png"
46+
"thumbnail": "https://a.url.com/to/a/thumbnail.png"
4747
}
4848
],
4949
"next": "https://a.url.com/to/next/page"

Sources/DynamicCodableKit/DynamicCodableKit.docc/Guides/ContainerCodingKey.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Alternative to <doc:TypeIdentifier>, in some JSON responses different types of o
4949
"createdAt": "2021-07-23T09:36:38Z",
5050
"url": "https://a.url.com/to/a/video.mp4",
5151
"duration": 460,
52-
"thumbnail": "https://a.url.com/to/a/thmbnail.png"
52+
"thumbnail": "https://a.url.com/to/a/thumbnail.png"
5353
}
5454
]
5555
},

Sources/DynamicCodableKit/DynamicCodableKit.docc/Guides/ContextProvider.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Decode dynamic JSON objects based on previous responses or actions by providing
44

55
## Overview
66

7-
In certain scenarios, the data type present in JSON response will be dependant on previous JSON reponses or a specific action performed. For example, in a social media post detail response, the data present will be indicated by the post type the detail is for, i.e. text based post, picture, audio or video post:
7+
In certain scenarios, the data type present in JSON response will be dependant on previous JSON responses or a specific action performed. For example, in a social media post detail response, the data present will be indicated by the post type the detail is for, i.e. text based post, picture, audio or video post:
88
```json
99
{
1010
"id": "00005678-abcd-efab-0123-456789abcdef",
@@ -49,7 +49,7 @@ In certain scenarios, the data type present in JSON response will be dependant o
4949
"createdAt": "2021-07-23T09:36:38Z",
5050
"url": "https://a.url.com/to/a/video.mp4",
5151
"duration": 460,
52-
"thumbnail": "https://a.url.com/to/a/thmbnail.png",
52+
"thumbnail": "https://a.url.com/to/a/thumbnail.png",
5353
"subTitles": "https://a.url.com/to/a/subTitles.srt",
5454
"aspectRatio": {
5555
"hight": 9,
@@ -58,7 +58,7 @@ In certain scenarios, the data type present in JSON response will be dependant o
5858
}
5959
```
6060

61-
To decode post detail JSON dynamically, type repesenting every post type: `TextPostDetail`, `PicturePostDetail`, `AudioPostDetail`, `VideoPostDetail` can be created, each confirming to ``DynamicDecodable`` and to protocol `PostDetail` which represents common post detail type.
61+
To decode post detail JSON dynamically, type representing every post type: `TextPostDetail`, `PicturePostDetail`, `AudioPostDetail`, `VideoPostDetail` can be created, each confirming to ``DynamicDecodable`` and to protocol `PostDetail` which represents common post detail type.
6262
![Decoded models hierarchy.](context-provider-class)
6363

6464
A ``DynamicDecodingContextProvider`` can be created to provide dynamic decoding context. For the current example, a type confirming ``UserInfoDynamicDecodingContextProvider`` can be created that provides the decoding context present in `Decoder`'s `userInfo` property associated to ``UserInfoDynamicDecodingContextProvider/infoKey``.

Sources/DynamicCodableKit/DynamicCodableKit.docc/Guides/TypeIdentifier.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ It is quite common in JSON responses to have objects that have some common field
4242
"createdAt": "2021-07-23T09:36:38Z",
4343
"url": "https://a.url.com/to/a/video.mp4",
4444
"duration": 460,
45-
"thumbnail": "https://a.url.com/to/a/thmbnail.png"
45+
"thumbnail": "https://a.url.com/to/a/thumbnail.png"
4646
}
4747
],
4848
"next": "https://a.url.com/to/next/page"
@@ -59,7 +59,7 @@ Decoding dynamically can be handled by creating types representing every post ty
5959

6060
### Implement Dynamic Decoding Contexts
6161

62-
Now `Post` type can be dynamically decoded to its concrete type based on value of `PostType` identiifier. `PostType` can be created as an `Enum` confirming to ``DynamicDecodingContextIdentifierKey`` while implementing the decoding context to use with ``DynamicDecodingContextIdentifierKey/associatedContext``. To allow `Decoder` to decode `PostType` and get dynamic decoding context, additional `CodingKey` type `PostCodingKey` need to be defined confirming to ``DynamicDecodingContextCodingKey``. Since current example only has one itentifier to decode confirming to ``DynamicDecodingContextIdentifierCodingKey`` and providing key that contains the identifier in ``DynamicDecodingContextIdentifierCodingKey/identifierCodingKey`` will suffice.
62+
Now `Post` type can be dynamically decoded to its concrete type based on value of `PostType` identifier. `PostType` can be created as an `Enum` confirming to ``DynamicDecodingContextIdentifierKey`` while implementing the decoding context to use with ``DynamicDecodingContextIdentifierKey/associatedContext``. To allow `Decoder` to decode `PostType` and get dynamic decoding context, additional `CodingKey` type `PostCodingKey` need to be defined confirming to ``DynamicDecodingContextCodingKey``. Since current example only has one identifier to decode confirming to ``DynamicDecodingContextIdentifierCodingKey`` and providing key that contains the identifier in ``DynamicDecodingContextIdentifierCodingKey/identifierCodingKey`` will suffice.
6363
```swift
6464
enum PostCodingKey: String, DynamicDecodingContextIdentifierCodingKey {
6565
typealias Identifier = PostType

Tests/DynamicCodableKitTests/DynamicDecodingContextCodingKey/Data/IdentifierCollectionDecode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let identifierCollectionDecode =
3636
"createdAt": "2021-07-23T09:36:38Z",
3737
"url": "https://a.url.com/to/a/video.mp4",
3838
"duration": 460,
39-
"thumbnail": "https://a.url.com/to/a/thmbnail.png"
39+
"thumbnail": "https://a.url.com/to/a/thumbnail.png"
4040
}
4141
],
4242
"next": "https://a.url.com/to/next/page"

0 commit comments

Comments
 (0)