forked from loafle/openapi-generator-original
Store last response in a thread-safe way
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module Petstore
|
||||
module Swagger
|
||||
class << self
|
||||
attr_accessor :logger, :last_response
|
||||
attr_accessor :logger
|
||||
|
||||
# A Swagger configuration object. Must act like a hash and return sensible
|
||||
# values for all Swagger configuration options. See Swagger::Configuration.
|
||||
|
||||
@@ -137,7 +137,7 @@ module Petstore
|
||||
end
|
||||
|
||||
# record as last response
|
||||
Swagger.last_response = @response
|
||||
Thread.current[:swagger_last_response] = @response
|
||||
|
||||
unless @response.success?
|
||||
fail ApiError.new(:code => @response.code,
|
||||
|
||||
Reference in New Issue
Block a user