openbel-api 1.0.2-java → 1.0.3-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/openbel/api/routes/datasets.rb +19 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25d2e441f67f4be259e2f3a594a66c1c6524c061
|
4
|
+
data.tar.gz: 2dde1eb0808d0f1ded754a447ca787c06e8196e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1564a9fa715f528b2dce42f4f6238fb78f15bced541a786eee8b7c595b325ce2d19a596fc07bab9e579976c560137ccb22bed17af2d1a00420462896e5d1f5f
|
7
|
+
data.tar.gz: 84721bf531574e8c9355a26246c7f039c8556f28a0f1914ae251609dbd7ded8792a4c7dd05f22cd825141abfbe4915cf72b1592f2b3c55c796746ca65fe99a4f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.3
|
@@ -72,16 +72,26 @@ module OpenBEL
|
|
72
72
|
def check_dataset(io, type)
|
73
73
|
begin
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
BEL.
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
75
|
+
begin
|
76
|
+
# See https://github.com/OpenBEL/openbel-api/issues/120
|
77
|
+
BEL.nanopub(io, type, :language => @bel_version).each do |nanopub|
|
78
|
+
BEL.object_convert(String, nanopub.to_h) { |str|
|
79
|
+
unless str.valid_encoding?
|
80
|
+
msg = 'Invalid encoding. UTF-8 is required.'
|
81
|
+
response = render_json({:status => 415, :msg => msg})
|
82
|
+
halt(415, { 'Content-Type' => 'application/json' }, response)
|
83
|
+
end
|
84
|
+
}
|
85
|
+
end
|
86
|
+
rescue Exception => e
|
87
|
+
puts e.message
|
88
|
+
puts e.backtrace.inspect
|
89
|
+
msg = 'Failed to parse the posted BEL nanopub.'
|
90
|
+
response = render_json({:status => 400, :msg => msg})
|
91
|
+
halt(400, { 'Content-Type' => 'application/json' }, response)
|
84
92
|
end
|
93
|
+
|
94
|
+
|
85
95
|
io.rewind
|
86
96
|
|
87
97
|
nanopub = BEL.nanopub(io, type).each.first
|