From 01bbdd2aae3afe2b02cf0a7f048ae48237fd5600 Mon Sep 17 00:00:00 2001 From: Adam Tistler Date: Thu, 27 Aug 2015 21:40:18 -0400 Subject: [PATCH] do not prepend "#/definitions" --- lib/swagger/blocks.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/swagger/blocks.rb b/lib/swagger/blocks.rb index f752bdd..eb7b5bc 100644 --- a/lib/swagger/blocks.rb +++ b/lib/swagger/blocks.rb @@ -233,7 +233,7 @@ def as_json elsif is_swagger_2_0? && value.is_a?(Hash) result[key] = {} value.each_pair {|k, v| result[key][k] = (v.respond_to?(:as_json) ? v.as_json : v) } - elsif is_swagger_2_0? && key.to_s.eql?('$ref') && (value.to_s !~ %r{^#/definitions/}) + elsif is_swagger_2_0? && key.to_s.eql?('$ref') && (value.to_s !~ %r{^#/}) result[key] = "#/definitions/#{value}" else result[key] = value @@ -753,4 +753,4 @@ def items(&block) end end end -end \ No newline at end of file +end