sexy_json_schemas 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,13 @@ module SexyJSONSchemas
7
7
  end
8
8
 
9
9
  def as_json
10
- {"$ref" => @schema}
10
+ json = { "$ref" => @schema }
11
+
12
+ if @options[:description]
13
+ json['description'] = @options[:description]
14
+ end
15
+
16
+ json
11
17
  end
12
18
  end
13
19
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "sexy_json_schemas"
7
- gem.version = "0.0.6"
7
+ gem.version = "0.0.7"
8
8
  gem.authors = ["Donald Plummer", "Michael Xavier"]
9
9
  gem.email = ["donald@crystalcommerce.com", "xavier@crystalcommerce.com"]
10
10
  gem.description = %q{A DSL for generating JSON Schemas}
@@ -286,7 +286,8 @@ describe SexyJSONSchemas do
286
286
  describe "$ref properties" do
287
287
  subject { Class.new(JSONTestClass) {
288
288
  schema "void", :root_element => false do
289
- ref_property "money", "http://example.com/money.json"
289
+ ref_property "money", "http://example.com/money.json",
290
+ :description => "Fun"
290
291
  end
291
292
  }}
292
293
 
@@ -295,7 +296,8 @@ describe SexyJSONSchemas do
295
296
  "type" => "object",
296
297
  "properties" => {
297
298
  "money" => {
298
- "$ref" => "http://example.com/money.json"
299
+ "$ref" => "http://example.com/money.json",
300
+ "description" => "Fun"
299
301
  }
300
302
  }
301
303
  }}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sexy_json_schemas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-09-28 00:00:00.000000000 Z
13
+ date: 2012-10-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake