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