Sha256: 2d4f55db74bbdb195844d90a9582e21ac4f7bcb4721d33c190e0c54b1c3f47c7

Contents?: true

Size: 481 Bytes

Versions: 7

Compression:

Stored size: 481 Bytes

Contents

class Taro::Types::ObjectTypes::FreeFormType < Taro::Types::ObjectType
  self.desc = 'An arbitrary, unvalidated Hash or JSON object. Use with care.'
  self.additional_properties = true
  self.openapi_name = 'FreeForm'

  def coerce_input
    object.is_a?(Hash) && object || input_error('must be a Hash')
  end

  def coerce_response
    object.respond_to?(:as_json) && (res = object.as_json).is_a?(Hash) && res ||
      response_error('must return a Hash from #as_json')
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
taro-2.3.0 lib/taro/types/object_types/free_form_type.rb
taro-2.2.0 lib/taro/types/object_types/free_form_type.rb
taro-2.1.0 lib/taro/types/object_types/free_form_type.rb
taro-2.0.0 lib/taro/types/object_types/free_form_type.rb
taro-1.4.0 lib/taro/types/object_types/free_form_type.rb
taro-1.3.0 lib/taro/types/object_types/free_form_type.rb
taro-1.2.0 lib/taro/types/object_types/free_form_type.rb