safrano 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c614ae343a00dc890ee0ac000282b16bb5f277ef582dbc405d50b86626cdbc0
4
- data.tar.gz: 132cf037593c59f02934ea3f5f4b064d5a4e7f35819f47de14e233d4b38a92f4
3
+ metadata.gz: 302464268b9b4475861347fca0cf7c330bed4dc35a0357b1ad4dc866b020134c
4
+ data.tar.gz: 968c331ca598e6eb84682ac8f2ab94aa71ac1cdfa83744b310a2a75e22dc3008
5
5
  SHA512:
6
- metadata.gz: '08a4d639dcf609cd92381040eaf27095b727600459daac78672c44b3c9996326c51d9e41b548fb4c1ecde3945cc3a15c6a43f59c7c7d235d37692449a8bda54e'
7
- data.tar.gz: 4ad800648dfe92564f29746a1b08d96a420f9cb5b647b32657b0f798fe1dda6305096921200ac093ec4258cfcacb3290b5703d8fc20832e727ee30add4c64db0
6
+ metadata.gz: 0c374f75c178787452357907e8e81ba315ac4f855ff4f658e40bbc7b5e9ae1d0d2a9849973c80a94e1101731dd79fbc597c51e4a804721da999db28535fd7c78
7
+ data.tar.gz: 3528b0d9150fd2b0bfc825894a03d438a77cf9d0b9bb11de2c3681938927d83187ac7ff21e16fb8240821f0f2931041ef0e75611928d8fa2948a8e377040ad24
@@ -270,7 +270,7 @@ module OData
270
270
  def odata_post(req)
271
271
  # TODO: check Request body format...
272
272
  # TODO: this is for v2 only...
273
- data = JSON.parse(req.body.read)['d']
273
+ data = JSON.parse(req.body.read)
274
274
  if req.accept?('application/json')
275
275
  [201, { 'Content-Type' => 'application/json;charset=utf-8' },
276
276
  new_from_hson_h(data).to_odata_post_json(service: req.service)]
data/lib/odata/entity.rb CHANGED
@@ -141,8 +141,7 @@ module OData
141
141
  end
142
142
 
143
143
  def odata_post(req)
144
- # TODO: check Request body format...
145
- data = JSON.parse(req.body.read)['d']
144
+ data = JSON.parse(req.body.read)
146
145
  @uribase = req.uribase
147
146
 
148
147
  if req.accept?('application/json')
@@ -157,16 +156,15 @@ module OData
157
156
  end
158
157
 
159
158
  def odata_patch(req)
160
- # TODO: check Request body format...
161
159
 
162
- data = JSON.parse(req.body.read)['d']
160
+ data = JSON.parse(req.body.read)
163
161
  @uribase = req.uribase
164
162
 
165
163
  if req.accept?('application/json')
166
164
  data.delete('__metadata')
167
165
  update_fields(data, self.class.data_fields, missing: :skip)
168
166
  # patch should return 204 + no content
169
- [204, []]
167
+ [204, {}, []]
170
168
  else # TODO: other formats
171
169
  415
172
170
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - D.M.