in codegen/projections/rails_json/lib/rails_json/parsers.rb [290:336]
def self.parse(http_resp)
data = Types::InputAndOutputWithHeadersOutput.new
data.header_string = http_resp.headers['X-String']
data.header_byte = http_resp.headers['X-Byte']&.to_i
data.header_short = http_resp.headers['X-Short']&.to_i
data.header_integer = http_resp.headers['X-Integer']&.to_i
data.header_long = http_resp.headers['X-Long']&.to_i
data.header_float = Seahorse::NumberHelper.deserialize(http_resp.headers['X-Float']) unless http_resp.headers['X-Float'].nil?
data.header_double = Seahorse::NumberHelper.deserialize(http_resp.headers['X-Double']) unless http_resp.headers['X-Double'].nil?
data.header_true_bool = http_resp.headers['X-Boolean1'] == 'true' unless http_resp.headers['X-Boolean1'].nil?
data.header_false_bool = http_resp.headers['X-Boolean2'] == 'true' unless http_resp.headers['X-Boolean2'].nil?
unless http_resp.headers['X-StringList'].nil? || http_resp.headers['X-StringList'].empty?
data.header_string_list = http_resp.headers['X-StringList']
.split(', ')
.map { |s| s.to_s }
end
unless http_resp.headers['X-StringSet'].nil? || http_resp.headers['X-StringSet'].empty?
data.header_string_set = Set.new(http_resp.headers['X-StringSet']
.split(', ')
.map { |s| s.to_s }
)
end
unless http_resp.headers['X-IntegerList'].nil? || http_resp.headers['X-IntegerList'].empty?
data.header_integer_list = http_resp.headers['X-IntegerList']
.split(', ')
.map { |s| s.to_i }
end
unless http_resp.headers['X-BooleanList'].nil? || http_resp.headers['X-BooleanList'].empty?
data.header_boolean_list = http_resp.headers['X-BooleanList']
.split(', ')
.map { |s| s == 'true' }
end
unless http_resp.headers['X-TimestampList'].nil? || http_resp.headers['X-TimestampList'].empty?
data.header_timestamp_list = http_resp.headers['X-TimestampList']
.split(', ')
.map { |s| Time.parse(s) }
end
data.header_enum = http_resp.headers['X-Enum']
unless http_resp.headers['X-EnumList'].nil? || http_resp.headers['X-EnumList'].empty?
data.header_enum_list = http_resp.headers['X-EnumList']
.split(', ')
.map { |s| s.to_s }
end
map = Seahorse::JSON.load(http_resp.body)
data
end