contentful 2.15.1 → 2.15.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/contentful/entry.rb +2 -1
- data/lib/contentful/version.rb +1 -1
- data/spec/entry_spec.rb +11 -0
- data/spec/fixtures/vcr_cassettes/entries/unresolvable_assets.yml +89 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2baecd9654f25b0d6291acd51d7d1d7c1005d07ce25e388ac3a8786235c3c9db
|
4
|
+
data.tar.gz: eb783626bf3ea0561a02a0d95b228457fbf9f4c22fea2778f1d06de00375b15e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1db162611a6a9049f04f5b1bdd35b14e20c0faebd716884efe3a69e8462ff641ce55f334d71ba509218ccb3979433f5e50390988151f257f7d4996bc4bfd475f
|
7
|
+
data.tar.gz: 060ea401389077fcc4f654e2f5888b24137adb0b484495caaf6cc2c5a0c3ca05165749aa84258e7b439902873acd5524d81c43d25935e4c6aff34c559806ffb3
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 2.15.2
|
6
|
+
### Fixed
|
7
|
+
* Fixed unresolvable single linked entries and assets returning a JSON Link rather than being `nil`, the same way they are filtered from Link arrays.
|
8
|
+
|
5
9
|
## 2.15.1
|
6
10
|
### Fixed
|
7
11
|
* Fixed how `entry_mapping` is cached in order to avoid errors when deserializing resources that have been serialized with previously deleted mapping classes. [#212](https://github.com/contentful/contentful.rb/issues/212)
|
data/lib/contentful/entry.rb
CHANGED
@@ -17,7 +17,8 @@ module Contentful
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def coerce(field_id, value, includes, errors, entries = {})
|
20
|
-
if Support.link?(value)
|
20
|
+
if Support.link?(value)
|
21
|
+
return nil if Support.unresolvable?(value, errors)
|
21
22
|
return build_nested_resource(value, includes, entries, errors)
|
22
23
|
end
|
23
24
|
return coerce_link_array(value, includes, errors, entries) if Support.link_array?(value)
|
data/lib/contentful/version.rb
CHANGED
data/spec/entry_spec.rb
CHANGED
@@ -486,6 +486,17 @@ describe Contentful::Entry do
|
|
486
486
|
end
|
487
487
|
|
488
488
|
describe 'issues' do
|
489
|
+
it 'filters out unresolvable assets' do
|
490
|
+
vcr('entries/unresolvable_assets') {
|
491
|
+
client = create_client(space: 'facgnwwgj5fe', access_token: '4d0f55d940975f78139daae5d965b463c0816e88ad16062d2c1ee3d6cb930521')
|
492
|
+
entry = client.entry('gLVzQlb09IeOeU181fwtz')
|
493
|
+
|
494
|
+
expect(entry.single_asset).to be_nil
|
495
|
+
expect(entry.multi_asset.size).to eq 1
|
496
|
+
expect(entry.raw["fields"]["multiAsset"].size).to eq 2
|
497
|
+
}
|
498
|
+
end
|
499
|
+
|
489
500
|
it 'Symbol/Text field with null values should be serialized as nil - #117' do
|
490
501
|
vcr('entries/issue_117') {
|
491
502
|
client = create_client(space: '8jbbayggj9gj', access_token: '4ce0108f04e55c76476ba84ab0e6149734db73d67cd1b429323ef67f00977e07')
|
@@ -0,0 +1,89 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://cdn.contentful.com/spaces/facgnwwgj5fe/environments/master/entries?sys.id=gLVzQlb09IeOeU181fwtz
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
X-Contentful-User-Agent:
|
11
|
+
- sdk contentful.rb/2.15.1; platform ruby/2.6.3; os macOS/18;
|
12
|
+
Authorization:
|
13
|
+
- Bearer 4d0f55d940975f78139daae5d965b463c0816e88ad16062d2c1ee3d6cb930521
|
14
|
+
Content-Type:
|
15
|
+
- application/vnd.contentful.delivery.v1+json
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip
|
18
|
+
Connection:
|
19
|
+
- close
|
20
|
+
Host:
|
21
|
+
- cdn.contentful.com
|
22
|
+
User-Agent:
|
23
|
+
- http.rb/4.2.0
|
24
|
+
response:
|
25
|
+
status:
|
26
|
+
code: 200
|
27
|
+
message: OK
|
28
|
+
headers:
|
29
|
+
Access-Control-Allow-Headers:
|
30
|
+
- Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature
|
31
|
+
Access-Control-Allow-Methods:
|
32
|
+
- GET,HEAD,OPTIONS
|
33
|
+
Access-Control-Allow-Origin:
|
34
|
+
- "*"
|
35
|
+
Access-Control-Expose-Headers:
|
36
|
+
- Etag
|
37
|
+
Access-Control-Max-Age:
|
38
|
+
- '86400'
|
39
|
+
Cf-Environment-Id:
|
40
|
+
- master
|
41
|
+
Cf-Environment-Uuid:
|
42
|
+
- 7df33faa-1d21-4dea-83e9-9ebda5f47ba9
|
43
|
+
Cf-Organization-Id:
|
44
|
+
- 4SsuxQCaMaemfIms52Jr8s
|
45
|
+
Cf-Space-Id:
|
46
|
+
- facgnwwgj5fe
|
47
|
+
Content-Encoding:
|
48
|
+
- gzip
|
49
|
+
Content-Type:
|
50
|
+
- application/vnd.contentful.delivery.v1+json
|
51
|
+
Contentful-Api:
|
52
|
+
- cda_cached
|
53
|
+
Etag:
|
54
|
+
- W/"14036385179019726604"
|
55
|
+
Server:
|
56
|
+
- Contentful
|
57
|
+
X-Content-Type-Options:
|
58
|
+
- nosniff
|
59
|
+
X-Contentful-Region:
|
60
|
+
- us-east-1
|
61
|
+
Content-Length:
|
62
|
+
- '832'
|
63
|
+
Accept-Ranges:
|
64
|
+
- bytes
|
65
|
+
Date:
|
66
|
+
- Thu, 19 Dec 2019 09:54:02 GMT
|
67
|
+
Via:
|
68
|
+
- 1.1 varnish
|
69
|
+
Age:
|
70
|
+
- '0'
|
71
|
+
Connection:
|
72
|
+
- close
|
73
|
+
X-Served-By:
|
74
|
+
- cache-ams21023-AMS
|
75
|
+
X-Cache:
|
76
|
+
- MISS
|
77
|
+
X-Cache-Hits:
|
78
|
+
- '0'
|
79
|
+
Vary:
|
80
|
+
- Accept-Encoding
|
81
|
+
X-Contentful-Request-Id:
|
82
|
+
- e8767cee-9cbe-46be-8fab-47d35d6c5db7
|
83
|
+
body:
|
84
|
+
encoding: ASCII-8BIT
|
85
|
+
string: !binary |-
|
86
|
+
H4sIAAAAAAAAA81WW2+bMBR+769APK8J5NbSt25r127VqqZJq22qIgMHYkoMwiZZWuW/zxdIHEpINk3TUBRhG5/znet3Xo8Mw6RLap4Zr/yVL9gyBb4yz7MMLU2+t3onvmEJQzHft+WKPuOULyy5iPEMM3FkqTVmMBMCf0iBSmxFi9REU+QJVeUXalPDIjbkZonpBpNnU+jcPFw7eR4VmO+lxMoH2BfmBMgLyWIRRv0AhFXls1q/SzvVY6o74c3Dy13sWs413MLYPrWDBXvRxK9xXRCWLfUDLwPEwD8XbjE7lu0c251j2xlZzlnf5r9Wtzf4rl/IU//3LgCZ4ywhMyBCx34XKotmiDLIqh461L0Xms69LsxgjilOSJkzhWe9hDCOuYjYftyHYvugya1NgJykuRtjOuVhoRQY3Z8FceKhWBYDkOPxfXlhnShmgCH2N7UjTDQZZurOeKPQKDRqGUYxCWOQ+wfF71A/KIm1HhhEEXr46OZkNIiW6PLh5+XYuRrvd8MsjxkukaqiVsHUo1dT4EXEG5DL5rEp3zrs/BOVup34PWTzG5/ln/E1HV4NrShiCx09b1V6Vuo++KdIH++6wym6fQzpt9GXr/e9IB/M4waga9BPxZsyQ/w/yQYLWZZkh3RU5SmSsCHQJJ4jl2eilnNlJKS8t9nsA0M4rqZz0VorrbcxbgdFrDBSwdtNEv+XSc0lVI0bJl6c+6CRa7WKNnm5RcJF5dQR5N+oszqaXNfZLqJsqK4i3vV5r5fhZriQfW/rqIEye5w1rVZ/YOuUyQE3kOauK7tpc7djG6iTXzq8ve2gzybH1pOoaJv11FRMa0X+1NCTAFwS1Kck9oEYGbAMwxwyg88snJWMFIfUCJKkEqAAS16rtNI8E1Oh2W7jGQqBtjwWIEmvLQKsrSdTuzY/2l3PPUXd7kkHen3/xHVcO+gg1wPUCzpgn1ptBXOyhjlRMCcC5kTAbEVpWB1p6npZWVX4Rdjh2J2T7jZPihoQVryxUhL7Avtsyo/6asxV0sp/cwo4nAoqH/QdjYXEuc5KWwGSYoVbv6KZHDP+yNTtiUpZ0I5SCHcw+xbJCMpZHa2OfgEgI0mYCAwAAA==
|
87
|
+
http_version:
|
88
|
+
recorded_at: Thu, 19 Dec 2019 09:54:02 GMT
|
89
|
+
recorded_with: VCR 5.0.0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.15.
|
4
|
+
version: 2.15.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Contentful GmbH (Jan Lelis)
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-12-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: http
|
@@ -455,6 +455,7 @@ files:
|
|
455
455
|
- spec/fixtures/vcr_cassettes/entries/rich_text_hydration_issue.yml
|
456
456
|
- spec/fixtures/vcr_cassettes/entries/rich_text_nested_fields.yml
|
457
457
|
- spec/fixtures/vcr_cassettes/entries/rich_text_unresolved_relationships.yml
|
458
|
+
- spec/fixtures/vcr_cassettes/entries/unresolvable_assets.yml
|
458
459
|
- spec/fixtures/vcr_cassettes/entries/unresolvable_filter.yml
|
459
460
|
- spec/fixtures/vcr_cassettes/entries/unresolvable_filter_deeply_nested.yml
|
460
461
|
- spec/fixtures/vcr_cassettes/entry.yml
|
@@ -604,6 +605,7 @@ test_files:
|
|
604
605
|
- spec/fixtures/vcr_cassettes/entries/rich_text_hydration_issue.yml
|
605
606
|
- spec/fixtures/vcr_cassettes/entries/rich_text_nested_fields.yml
|
606
607
|
- spec/fixtures/vcr_cassettes/entries/rich_text_unresolved_relationships.yml
|
608
|
+
- spec/fixtures/vcr_cassettes/entries/unresolvable_assets.yml
|
607
609
|
- spec/fixtures/vcr_cassettes/entries/unresolvable_filter.yml
|
608
610
|
- spec/fixtures/vcr_cassettes/entries/unresolvable_filter_deeply_nested.yml
|
609
611
|
- spec/fixtures/vcr_cassettes/entry.yml
|