contentful 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4d77892915ecd8239523a3445facfbcbff8f03b
4
- data.tar.gz: 65e3c98c2dd333f74615dee6ad4e9ed2699afef8
3
+ metadata.gz: e0282a011ae90a4b76aad56ea87739191d7cfad3
4
+ data.tar.gz: 1a07148812c1bc8bb976f03e1816a5070790d880
5
5
  SHA512:
6
- metadata.gz: 21706998470709e18960a3076c99c4000198ab43d83bd2ceda74ff30f2de4b5fb5328c380b2fb75075ab0516ed5533c24bf223a2ded42b13a96858e3ecc2b23d
7
- data.tar.gz: ed72531068cd0f7d5f563460a818e598d6dbd3ecfc6c2571bba14791d3b533314d9e599350f2caed23d4401839a0def68c85682dceb21257286c5728ba86ec4e
6
+ metadata.gz: 98d2ad17326e6bdd452b49bf20494a54b19667b14e31962abdbc07864de7bf0e77ce5cf31ddb91cbf6bf0f396382ec30d2fdb3c6bd4ff8bd5123b1a0fd0abe83
7
+ data.tar.gz: 8f906415d0e28f43e6a996eb5caf68f2885ff605ad56a4fa9688ab612378a006ddac539dd190a6d956cd1572f6c4bbbe1d6a337cc456b45c6ff35bdaf177b4bc
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.2.2
6
+ ### Fixed
7
+ * Fixed Symbol/Text field serialization when value is `null` [#117](https://github.com/contentful/contentful.rb/issues/117)
8
+
5
9
  ## 1.2.1
6
10
  ### Added
7
11
  * Update dependency versions
@@ -18,7 +18,7 @@ module Contentful
18
18
  # @private
19
19
  # rubocop:disable Style/DoubleNegation
20
20
  COERCIONS = {
21
- string: ->(v) { v.to_s },
21
+ string: ->(v) { v.nil? ? nil : v.to_s },
22
22
  integer: ->(v) { v.to_i },
23
23
  float: ->(v) { v.to_f },
24
24
  boolean: ->(v) { !!v },
@@ -1,5 +1,5 @@
1
1
  # Contentful Namespace
2
2
  module Contentful
3
3
  # Gem Version
4
- VERSION = '1.2.1'
4
+ VERSION = '1.2.2'
5
5
  end
@@ -313,4 +313,16 @@ describe Contentful::Entry do
313
313
  end
314
314
  end
315
315
  end
316
+
317
+ describe 'issues' do
318
+ it 'Symbol/Text field with null values should be serialized as nil - #117' do
319
+ vcr('entries/issue_117') {
320
+ client = create_client(space: '8jbbayggj9gj', access_token: '4ce0108f04e55c76476ba84ab0e6149734db73d67cd1b429323ef67f00977e07', dynamic_entries: :auto)
321
+ entry = client.entries.first
322
+
323
+ expect(entry.nil).to be_nil
324
+ expect(entry.nil).not_to eq ''
325
+ }
326
+ end
327
+ end
316
328
  end
@@ -0,0 +1,201 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cdn.contentful.com/spaces/8jbbayggj9gj/content_types?limit=1000
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - RubyContentfulGem/1.2.1
12
+ Authorization:
13
+ - Bearer 4ce0108f04e55c76476ba84ab0e6149734db73d67cd1b429323ef67f00977e07
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
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Access-Control-Allow-Headers:
28
+ - 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
29
+ Access-Control-Allow-Methods:
30
+ - GET,HEAD,OPTIONS
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Access-Control-Expose-Headers:
34
+ - Etag
35
+ Access-Control-Max-Age:
36
+ - '86400'
37
+ Cache-Control:
38
+ - max-age=0
39
+ Content-Encoding:
40
+ - gzip
41
+ Content-Type:
42
+ - application/vnd.contentful.delivery.v1+json
43
+ Etag:
44
+ - W/"d02c518f396fb5eb186d791cf1cc57cb"
45
+ Server:
46
+ - Contentful
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ - nosniff
50
+ X-Contentful-Request-Id:
51
+ - d68e2dbfc63f32d5054ac63537e8d03e
52
+ Content-Length:
53
+ - '375'
54
+ Accept-Ranges:
55
+ - bytes
56
+ Date:
57
+ - Tue, 03 Jan 2017 11:34:30 GMT
58
+ Via:
59
+ - 1.1 varnish
60
+ Age:
61
+ - '5788'
62
+ Connection:
63
+ - close
64
+ X-Served-By:
65
+ - cache-gru7126-GRU
66
+ X-Cache:
67
+ - HIT
68
+ X-Cache-Hits:
69
+ - '1'
70
+ X-Timer:
71
+ - S1483443270.292050,VS0,VE0
72
+ Vary:
73
+ - Accept-Encoding
74
+ body:
75
+ encoding: ASCII-8BIT
76
+ string: !binary |-
77
+ H4sIAAAAAAAAA9VTvW7CMBDeeQrkuVQmUkXLhqp2qlhgasXgJAYdOI5rm0ou
78
+ 4t3rs0lwUhi6US/J3fm+n7vkMBgOiXGGTIcH/+oD6xT3EZlpzRzxueMd3rG1
79
+ ZcLnxyEyO1A+oCEQUIHFEqUxAZZXiPgRECNujyZQGcUK5GpuxGQiBhMh2Yh6
80
+ A7kjSHo+nl7ulifRi4DYuwAl+nnc5jlzm832abNFW805tu/BaDwk9lhubILW
81
+ yniupeXSBtakqdCcWV7OcBgko+PJiI5HNFtmdEon0+zh3k/oPW3Yq/JvDZp/
82
+ gYFa4rRPYlvVpASjBHOvwEVwLFl1lhcjn12mnkjJTaFB2YhJWnFkjSjnJeJY
83
+ OmuKA+pQ4J2WZp6Sh0qzw4Wr8lp0lkREXTAB3xx1r5kwPF0h0fxzD/pK0btm
84
+ ubhSrP2X6TfSoF5a9QVXvFLWdQUGo356L79L/8eXhN7YG1fzfuGmPJ22tgpP
85
+ /F1Xg+PgB3EoeHC5BAAA
86
+ http_version:
87
+ recorded_at: Tue, 03 Jan 2017 11:34:30 GMT
88
+ - request:
89
+ method: get
90
+ uri: https://cdn.contentful.com/spaces/8jbbayggj9gj/entries
91
+ body:
92
+ encoding: US-ASCII
93
+ string: ''
94
+ headers:
95
+ User-Agent:
96
+ - RubyContentfulGem/1.2.1
97
+ Authorization:
98
+ - Bearer 4ce0108f04e55c76476ba84ab0e6149734db73d67cd1b429323ef67f00977e07
99
+ Content-Type:
100
+ - application/vnd.contentful.delivery.v1+json
101
+ Accept-Encoding:
102
+ - gzip
103
+ Connection:
104
+ - close
105
+ Host:
106
+ - cdn.contentful.com
107
+ response:
108
+ status:
109
+ code: 200
110
+ message: OK
111
+ headers:
112
+ Access-Control-Allow-Headers:
113
+ - 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
114
+ Access-Control-Allow-Methods:
115
+ - GET,HEAD,OPTIONS
116
+ Access-Control-Allow-Origin:
117
+ - "*"
118
+ Access-Control-Expose-Headers:
119
+ - Etag
120
+ Access-Control-Max-Age:
121
+ - '86400'
122
+ Cache-Control:
123
+ - max-age=0
124
+ Content-Type:
125
+ - application/vnd.contentful.delivery.v1+json
126
+ Etag:
127
+ - '"16bd1168ea8f89e34f0a4d2eb7e905c5"'
128
+ Server:
129
+ - Contentful
130
+ X-Content-Type-Options:
131
+ - nosniff
132
+ - nosniff
133
+ X-Contentful-Request-Id:
134
+ - 3e7f93d9d3d1ca80aa17f60fd8a644bc
135
+ Content-Length:
136
+ - '753'
137
+ Accept-Ranges:
138
+ - bytes
139
+ Date:
140
+ - Tue, 03 Jan 2017 11:34:30 GMT
141
+ Via:
142
+ - 1.1 varnish
143
+ Age:
144
+ - '5774'
145
+ Connection:
146
+ - close
147
+ X-Served-By:
148
+ - cache-gru7122-GRU
149
+ X-Cache:
150
+ - HIT
151
+ X-Cache-Hits:
152
+ - '1'
153
+ X-Timer:
154
+ - S1483443270.462614,VS0,VE0
155
+ Vary:
156
+ - Accept-Encoding
157
+ body:
158
+ encoding: ASCII-8BIT
159
+ string: |
160
+ {
161
+ "sys": {
162
+ "type": "Array"
163
+ },
164
+ "total": 1,
165
+ "skip": 0,
166
+ "limit": 100,
167
+ "items": [
168
+ {
169
+ "sys": {
170
+ "space": {
171
+ "sys": {
172
+ "type": "Link",
173
+ "linkType": "Space",
174
+ "id": "8jbbayggj9gj"
175
+ }
176
+ },
177
+ "id": "3vuP7wtireIWM2WO2oiw4u",
178
+ "type": "Entry",
179
+ "createdAt": "2017-01-02T20:07:37.872Z",
180
+ "updatedAt": "2017-01-03T09:57:26.558Z",
181
+ "revision": 3,
182
+ "contentType": {
183
+ "sys": {
184
+ "type": "Link",
185
+ "linkType": "ContentType",
186
+ "id": "test"
187
+ }
188
+ },
189
+ "locale": "en-US"
190
+ },
191
+ "fields": {
192
+ "name": "Test",
193
+ "empty": "",
194
+ "nil": null
195
+ }
196
+ }
197
+ ]
198
+ }
199
+ http_version:
200
+ recorded_at: Tue, 03 Jan 2017 11:34:30 GMT
201
+ recorded_with: VCR 3.0.3
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: 1.2.1
4
+ version: 1.2.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: 2016-12-22 00:00:00.000000000 Z
13
+ date: 2017-01-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: http
@@ -384,6 +384,7 @@ files:
384
384
  - spec/fixtures/vcr_cassettes/bad_request.yml
385
385
  - spec/fixtures/vcr_cassettes/content_type.yml
386
386
  - spec/fixtures/vcr_cassettes/entries.yml
387
+ - spec/fixtures/vcr_cassettes/entries/issue_117.yml
387
388
  - spec/fixtures/vcr_cassettes/entry.yml
388
389
  - spec/fixtures/vcr_cassettes/entry/custom_resource.yml
389
390
  - spec/fixtures/vcr_cassettes/entry/json_objects.yml
@@ -491,6 +492,7 @@ test_files:
491
492
  - spec/fixtures/vcr_cassettes/bad_request.yml
492
493
  - spec/fixtures/vcr_cassettes/content_type.yml
493
494
  - spec/fixtures/vcr_cassettes/entries.yml
495
+ - spec/fixtures/vcr_cassettes/entries/issue_117.yml
494
496
  - spec/fixtures/vcr_cassettes/entry.yml
495
497
  - spec/fixtures/vcr_cassettes/entry/custom_resource.yml
496
498
  - spec/fixtures/vcr_cassettes/entry/json_objects.yml