json_world 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6435e6e014ae5822d8ec98e401345470c68478c9
4
- data.tar.gz: 4c480dded8989f2012462755bb115b2967e8f67d
3
+ metadata.gz: f47fd3e6fa82da31da36b53d47496945da7852fb
4
+ data.tar.gz: 0e638d6c731d1ccccd98ab5607ffef275c334273
5
5
  SHA512:
6
- metadata.gz: ca5e0036a01596dabca1e5a1224e415ea59b1a401233edd0d108210593bbee390ea6aa268742056f4f2645be60a5b0778664a4a5951bebe1ebfb2bd9b4e05daa
7
- data.tar.gz: dd686cbcd375e39565941be1345887b5309a937a1f4518efbd88a8025fb7125025b4f17ed1a55452938015b0002bcf77265f82818664f4442a469d910beaec67
6
+ metadata.gz: 460be1b1b095b4c64cbaaba1d777a72c59bd49ac04dbd12dff490cf1ec2b169045edfb70bd7fdadfe5c4304149e3fded79d1a57099afab2bff3b67354fad931a
7
+ data.tar.gz: fab931e7015a9c94b8117921fd82b65eec50138e7a79f893f8713d3dfb985b78492a0210fa385f9b0859c8aeeb7d27ddf3fc58f79142d4f1a9b89e82f73334ab
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.2
2
+ - Remove links property from embedded object
3
+ - Fix bug that links are unexpectedly shared by other classes
4
+
1
5
  ## 0.1.1
2
6
  - Support embedding other JSON-Schema compatible object via type
3
7
  - Support rel property on LinkDefinition
@@ -33,10 +33,17 @@ module JsonWorld
33
33
  end
34
34
  end
35
35
 
36
+ # @return [Hash]
37
+ def as_json_schema_without_link
38
+ as_json_schema.reject do |key, _value|
39
+ key == :links
40
+ end
41
+ end
42
+
36
43
  # @note Override
37
44
  def inherited(child)
38
45
  super
39
- child.link_definitions = link_definitions
46
+ child.link_definitions = link_definitions.clone
40
47
  child.property_definitions = property_definitions.clone
41
48
  end
42
49
 
@@ -14,7 +14,7 @@ module JsonWorld
14
14
 
15
15
  # @return [Hash{Symbol => Object}]
16
16
  def as_json_schema
17
- @options[:type].try(:as_json_schema) || {
17
+ @options[:type].try(:as_json_schema_without_link) || {
18
18
  description: description,
19
19
  example: example,
20
20
  format: format_type,
@@ -1,3 +1,3 @@
1
1
  module JsonWorld
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_world
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura