Skip to content

Commit

Permalink
Merge pull request #252 from contentful/hotfix/protocol-check
Browse files Browse the repository at this point in the history
Debug protocol conformance check in fetch by id method
  • Loading branch information
loudmouth authored Dec 6, 2018
2 parents 9951739 + 914e4bf commit 6df9324
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 176 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CONTENTFUL_SDK_VERSION=4.2.2
CONTENTFUL_SDK_VERSION=4.2.3
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) starting from
## Table of contents

#### 4.x Releases
- `4.2.0` Releases - [4.2.0](#420) | [4.2.1](#421) | [4.2.2](#422)
- `4.2.0` Releases - [4.2.0](#420) | [4.2.1](#421) | [4.2.2](#422) | [4.2.3](#423)
- `4.1.0` Releases - [4.1.0](#410) | [4.1.3](#413)
- `4.0.0` Releases - [4.0.0](#400) | [4.0.1](#401)

Expand Down Expand Up @@ -40,6 +40,14 @@ This project adheres to [Semantic Versioning](http://semver.org/) starting from

---

## [`4.2.3`](https://github.com/contentful/contentful.swift/releases/tag/4.2.3)
Released on 2018-12-06

#### Fixes
- Check for protocol conformance when fetching an `EntryDecodable` by id that prevented links from being resolved.

---

## [`4.2.2`](https://github.com/contentful/contentful.swift/releases/tag/4.2.2)
Released on 2018-12-02

Expand Down
2 changes: 1 addition & 1 deletion Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CONTENTFUL_SDK_VERSION=4.2.2
CONTENTFUL_SDK_VERSION=4.2.3
16 changes: 8 additions & 8 deletions Contentful.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
5D09C26421870C27006B83F4 /* PreviewSyncTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23B21870C27006B83F4 /* PreviewSyncTests.json */; };
5D09C26621870C27006B83F4 /* AssetTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23C21870C27006B83F4 /* AssetTests.json */; };
5D09C26721870C27006B83F4 /* AssetTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23C21870C27006B83F4 /* AssetTests.json */; };
5D09C26921870C27006B83F4 /* LinkResolverTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23D21870C27006B83F4 /* LinkResolverTests.json */; };
5D09C26A21870C27006B83F4 /* LinkResolverTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23D21870C27006B83F4 /* LinkResolverTests.json */; };
5D09C26C21870C27006B83F4 /* testClientCanAccessPreviewAPI.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23E21870C27006B83F4 /* testClientCanAccessPreviewAPI.json */; };
5D09C26D21870C27006B83F4 /* testClientCanAccessPreviewAPI.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23E21870C27006B83F4 /* testClientCanAccessPreviewAPI.json */; };
5D52E2462193375300C88FC9 /* RichText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DD410462190BC8B003FC01E /* RichText.swift */; };
Expand Down Expand Up @@ -71,7 +69,6 @@
5D52E2762193381F00C88FC9 /* EnvironmentsTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23421870C27006B83F4 /* EnvironmentsTests.json */; };
5D52E2772193381F00C88FC9 /* ErrorTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23121870C26006B83F4 /* ErrorTests.json */; };
5D52E2782193381F00C88FC9 /* ImageTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23521870C27006B83F4 /* ImageTests.json */; };
5D52E2792193381F00C88FC9 /* LinkResolverTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23D21870C27006B83F4 /* LinkResolverTests.json */; };
5D52E27A2193381F00C88FC9 /* LocalizationTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23621870C27006B83F4 /* LocalizationTests.json */; };
5D52E27B2193381F00C88FC9 /* PreviewSyncTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23B21870C27006B83F4 /* PreviewSyncTests.json */; };
5D52E27C2193381F00C88FC9 /* QueryTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D09C23721870C27006B83F4 /* QueryTests.json */; };
Expand Down Expand Up @@ -105,6 +102,9 @@
5D52E2A02193387600C88FC9 /* OHHTTPStubs.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D52E29F2193387600C88FC9 /* OHHTTPStubs.framework */; };
5D52E2A22193388200C88FC9 /* DVR.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D52E2A12193388200C88FC9 /* DVR.framework */; };
5D52E2A62193388200C88FC9 /* OHHTTPStubs.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D52E2A52193388200C88FC9 /* OHHTTPStubs.framework */; };
5D73EE3921B915C60091DB67 /* LinkResolverTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D73EE3821B915C60091DB67 /* LinkResolverTests.json */; };
5D73EE3A21B915C60091DB67 /* LinkResolverTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D73EE3821B915C60091DB67 /* LinkResolverTests.json */; };
5D73EE3B21B915C60091DB67 /* LinkResolverTests.json in Resources */ = {isa = PBXBuildFile; fileRef = 5D73EE3821B915C60091DB67 /* LinkResolverTests.json */; };
5DBCEA7821A6DA5A00BA055C /* Location.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DBCEA7721A6DA5A00BA055C /* Location.swift */; };
5DBCEA7921A6DA5A00BA055C /* Location.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DBCEA7721A6DA5A00BA055C /* Location.swift */; };
5DBCEA7A21A6DA5A00BA055C /* Location.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DBCEA7721A6DA5A00BA055C /* Location.swift */; };
Expand Down Expand Up @@ -280,7 +280,6 @@
5D09C23A21870C27006B83F4 /* SyncTests.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = SyncTests.json; sourceTree = "<group>"; };
5D09C23B21870C27006B83F4 /* PreviewSyncTests.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = PreviewSyncTests.json; sourceTree = "<group>"; };
5D09C23C21870C27006B83F4 /* AssetTests.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = AssetTests.json; sourceTree = "<group>"; };
5D09C23D21870C27006B83F4 /* LinkResolverTests.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = LinkResolverTests.json; sourceTree = "<group>"; };
5D09C23E21870C27006B83F4 /* testClientCanAccessPreviewAPI.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testClientCanAccessPreviewAPI.json; sourceTree = "<group>"; };
5D52E23D2193374100C88FC9 /* Contentful.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Contentful.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5D52E266219337AF00C88FC9 /* ContentfulTests_tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ContentfulTests_tvOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -293,6 +292,7 @@
5D52E2A12193388200C88FC9 /* DVR.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DVR.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5D52E2A32193388200C88FC9 /* Nimble.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Nimble.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5D52E2A52193388200C88FC9 /* OHHTTPStubs.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = OHHTTPStubs.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5D73EE3821B915C60091DB67 /* LinkResolverTests.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = LinkResolverTests.json; sourceTree = "<group>"; };
5DBCEA7721A6DA5A00BA055C /* Location.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Location.swift; sourceTree = "<group>"; };
5DC635C6219997A8001E3174 /* ContentfulLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentfulLogger.swift; sourceTree = "<group>"; };
5DC635CE219AC0B0001E3174 /* LoggerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -608,14 +608,14 @@
ED9102671E65AE880076FDBD /* DVRRecordings */ = {
isa = PBXGroup;
children = (
5D73EE3821B915C60091DB67 /* LinkResolverTests.json */,
5DD410E421918E62003FC01E /* RichTextNodeDecodingTests.json */,
5DFE08DA2189D6AC00B0D68E /* EntryTests.json */,
5D09C23C21870C27006B83F4 /* AssetTests.json */,
5D09C23921870C27006B83F4 /* ContentTypeTests.json */,
5D09C23421870C27006B83F4 /* EnvironmentsTests.json */,
5D09C23121870C26006B83F4 /* ErrorTests.json */,
5D09C23521870C27006B83F4 /* ImageTests.json */,
5D09C23D21870C27006B83F4 /* LinkResolverTests.json */,
5D09C23621870C27006B83F4 /* LocalizationTests.json */,
5D09C23B21870C27006B83F4 /* PreviewSyncTests.json */,
5D09C23721870C27006B83F4 /* QueryTests.json */,
Expand Down Expand Up @@ -889,13 +889,13 @@
5D52E2762193381F00C88FC9 /* EnvironmentsTests.json in Resources */,
5D52E2772193381F00C88FC9 /* ErrorTests.json in Resources */,
5D52E2782193381F00C88FC9 /* ImageTests.json in Resources */,
5D52E2792193381F00C88FC9 /* LinkResolverTests.json in Resources */,
5D52E27A2193381F00C88FC9 /* LocalizationTests.json in Resources */,
5D52E27B2193381F00C88FC9 /* PreviewSyncTests.json in Resources */,
5D52E27C2193381F00C88FC9 /* QueryTests.json in Resources */,
5D52E27D2193381F00C88FC9 /* RateLimitTests.json in Resources */,
5D52E27E2193381F00C88FC9 /* SyncTests.json in Resources */,
5D52E27F2193381F00C88FC9 /* testClientCanAccessPreviewAPI.json in Resources */,
5D73EE3B21B915C60091DB67 /* LinkResolverTests.json in Resources */,
5D52E2802193381F00C88FC9 /* testClientCantAccessPreviewAPIWithProductionToken.json in Resources */,
5D52E2812193381F00C88FC9 /* testFetchSpace.json in Resources */,
5D52E2822193381F00C88FC9 /* Fixtures in Resources */,
Expand Down Expand Up @@ -926,8 +926,8 @@
5D09C26621870C27006B83F4 /* AssetTests.json in Resources */,
5D09C24221870C27006B83F4 /* testClientCantAccessPreviewAPIWithProductionToken.json in Resources */,
5DFE08DB2189D6AC00B0D68E /* EntryTests.json in Resources */,
5D73EE3921B915C60091DB67 /* LinkResolverTests.json in Resources */,
ED02DC9F20E12405005EC57B /* Fixtures in Resources */,
5D09C26921870C27006B83F4 /* LinkResolverTests.json in Resources */,
5D09C24B21870C27006B83F4 /* testFetchSpace.json in Resources */,
5D09C24521870C27006B83F4 /* ErrorTests.json in Resources */,
);
Expand All @@ -938,7 +938,6 @@
buildActionMask = 2147483647;
files = (
5D09C24621870C27006B83F4 /* ErrorTests.json in Resources */,
5D09C26A21870C27006B83F4 /* LinkResolverTests.json in Resources */,
5D09C24C21870C27006B83F4 /* testFetchSpace.json in Resources */,
5D09C26721870C27006B83F4 /* AssetTests.json in Resources */,
5D09C26D21870C27006B83F4 /* testClientCanAccessPreviewAPI.json in Resources */,
Expand All @@ -951,6 +950,7 @@
5D09C25521870C27006B83F4 /* LocalizationTests.json in Resources */,
5DFE08DC2189D6AC00B0D68E /* EntryTests.json in Resources */,
5D09C25221870C27006B83F4 /* ImageTests.json in Resources */,
5D73EE3A21B915C60091DB67 /* LinkResolverTests.json in Resources */,
5D09C25E21870C27006B83F4 /* ContentTypeTests.json in Resources */,
5D09C24921870C27006B83F4 /* RateLimitTests.json in Resources */,
5D09C24321870C27006B83F4 /* testClientCantAccessPreviewAPIWithProductionToken.json in Resources */,
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,23 @@ pod 'Contentful'
You can specify a specific version of Contentful depending on your needs. To learn more about operators for dependency versioning within a Podfile, see the [CocoaPods doc on the Podfile](https://guides.cocoapods.org/using/the-podfile.html).

```ruby
pod 'Contentful', '~> 4.2.2'
pod 'Contentful', '~> 4.2.3'
```

#### Carthage installation

You can also use [Carthage](https://github.com/Carthage/Carthage) for integration by adding the following to your `Cartfile`:

```
github "contentful/contentful.swift" ~> 4.2.2
github "contentful/contentful.swift" ~> 4.2.3
```

#### Swift Package Manager [swift-tools-version 4.2]

Add the following line to your array of dependencies:

```swift
.package(url: "https://github.com/contentful/contentful.swift", .upToNextMajor(from: "4.2.2"))
.package(url: "https://github.com/contentful/contentful.swift", .upToNextMajor(from: "4.2.3"))
```

### Your first request
Expand Down
2 changes: 1 addition & 1 deletion Sources/Contentful/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ extension Client {
where ResourceType: Decodable & EndpointAccessible {

// If the resource is not an entry, then don't worry about fetching with includes.
if resourceType != EntryDecodable.self && resourceType != Entry.self {
if !(resourceType is EntryDecodable.Type) && resourceType != Entry.self {
var url = self.url(endpoint: ResourceType.endpoint)
url.appendPathComponent(id)
return fetch(url: url, then: completion)
Expand Down
Loading

0 comments on commit 6df9324

Please sign in to comment.