autoparse 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.1
2
+
3
+ * fixed URI resolution when base URI is missing
4
+
1
5
  == 0.2.0
2
6
 
3
7
  * added support for union types
@@ -204,7 +204,11 @@ module AutoParse
204
204
 
205
205
  # Verify property values
206
206
  if schema_data['$ref']
207
- schema_uri = self.uri + Addressable::URI.parse(schema_data['$ref'])
207
+ if self.uri
208
+ schema_uri = self.uri + Addressable::URI.parse(schema_data['$ref'])
209
+ else
210
+ schema_uri = Addressable::URI.parse(schema_data['$ref'])
211
+ end
208
212
  schema = AutoParse.schemas[schema_uri]
209
213
  if schema == nil
210
214
  raise ArgumentError,
@@ -18,7 +18,7 @@ unless defined? AutoParse::VERSION
18
18
  module VERSION
19
19
  MAJOR = 0
20
20
  MINOR = 2
21
- TINY = 0
21
+ TINY = 1
22
22
 
23
23
  STRING = [MAJOR, MINOR, TINY].join('.')
24
24
  end
data/lib/autoparse.rb CHANGED
@@ -286,7 +286,12 @@ module AutoParse
286
286
  end)
287
287
  items_data = schema_class.data['items']
288
288
  if items_data && items_data['$ref']
289
- items_uri = schema_class.uri + Addressable::URI.parse(items_data['$ref'])
289
+ if schema_class && schema_class.uri
290
+ items_uri =
291
+ schema_class.uri + Addressable::URI.parse(items_data['$ref'])
292
+ else
293
+ items_uri = Addressable::URI.parse(items_data['$ref'])
294
+ end
290
295
  items_schema = AutoParse.schemas[items_uri]
291
296
  if items_schema
292
297
  array.map! do |item|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoparse
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bob Aman
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-05 00:00:00 Z
18
+ date: 2011-10-14 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: addressable