schema_registry 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/schema_registry/client.rb +1 -1
- data/lib/schema_registry/subject.rb +7 -0
- data/lib/schema_registry/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1d530b329c2ffc4f471bed84fc897843fdc932b
|
4
|
+
data.tar.gz: b770be7557c4c038494147e5aed96d1052d3f486
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c45a230a3a73add3ec82751dcdc275979d5cd27f38c769157c819864da2ad8beae1de676c0dd960d854487a1e50dddbb8d3e839ca950b743253e3644e045c77
|
7
|
+
data.tar.gz: 7bf8a528e69c471c4d25ae299fd00d0a0ca68c0dfa5d42a3fa7148cd950829a192cd22fce37a001517f549741c41e33fa1b315e78e30cd810c5c39d530889bab
|
@@ -85,7 +85,7 @@ module SchemaRegistry
|
|
85
85
|
raise SchemaRegistry::UnauthorizedRequest.new(response.code.to_i, message)
|
86
86
|
|
87
87
|
else
|
88
|
-
|
88
|
+
response_data = begin
|
89
89
|
JSON.parse(response.body)
|
90
90
|
rescue JSON::ParserError => e
|
91
91
|
raise SchemaRegistry::InvalidResponse, "Invalid JSON in response: #{e.message}"
|
@@ -34,6 +34,13 @@ module SchemaRegistry
|
|
34
34
|
SchemaRegistration.new(self, client.request(:post, "/subjects/#{name}", schema: schema_json))
|
35
35
|
end
|
36
36
|
|
37
|
+
def schema_registered?(schema_json)
|
38
|
+
verify_schema(schema_json)
|
39
|
+
true
|
40
|
+
rescue SubjectNotFound, SchemaNotFound
|
41
|
+
false
|
42
|
+
end
|
43
|
+
|
37
44
|
def register_schema(schema_json)
|
38
45
|
client.request(:post, "/subjects/#{name}/versions", schema: schema_json)['id']
|
39
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_registry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willem van Bergen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|