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 +4 -4
- data/lib/odata/collection.rb +1 -1
- data/lib/odata/entity.rb +3 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 302464268b9b4475861347fca0cf7c330bed4dc35a0357b1ad4dc866b020134c
|
4
|
+
data.tar.gz: 968c331ca598e6eb84682ac8f2ab94aa71ac1cdfa83744b310a2a75e22dc3008
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c374f75c178787452357907e8e81ba315ac4f855ff4f658e40bbc7b5e9ae1d0d2a9849973c80a94e1101731dd79fbc597c51e4a804721da999db28535fd7c78
|
7
|
+
data.tar.gz: 3528b0d9150fd2b0bfc825894a03d438a77cf9d0b9bb11de2c3681938927d83187ac7ff21e16fb8240821f0f2931041ef0e75611928d8fa2948a8e377040ad24
|
data/lib/odata/collection.rb
CHANGED
@@ -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)
|
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
|
-
|
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)
|
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
|