diff --git a/lib/sinatra/swagger-exposer/processing/swagger-response-processor.rb b/lib/sinatra/swagger-exposer/processing/swagger-response-processor.rb index 713812c..36ef2da 100644 --- a/lib/sinatra/swagger-exposer/processing/swagger-response-processor.rb +++ b/lib/sinatra/swagger-exposer/processing/swagger-response-processor.rb @@ -32,8 +32,8 @@ def useful? def validate_response(response_body) parsed_response_body = nil begin - parsed_response_body = JSON.parse(response_body) - rescue JSON::ParserError => e + parsed_response_body = ::JSON.parse(response_body) + rescue ::JSON::ParserError => e raise SwaggerInvalidException.new("Response is not a valid json [#{response_body}]") end if @processor @@ -44,4 +44,4 @@ def validate_response(response_body) end end end -end \ No newline at end of file +end