Class: Mountapi::Schema::Array
- Inherits:
-
Object
- Object
- Mountapi::Schema::Array
- Includes:
- Base
- Defined in:
- lib/mountapi/schema/array.rb
Overview
Schema implementation for Array
Class Method Summary collapse
-
.to_json_schema(key_name, value) ⇒ Object
for array we also transform items to json_schema.
Instance Method Summary collapse
-
#cast(array) ⇒ Object
cast the inbound value and it’s items in case of array we already expect an array.
Methods included from Base
Class Method Details
Instance Method Details
#cast(array) ⇒ Object
cast the inbound value and it’s items in case of array we already expect an array. (from rack Query parser)
13 14 15 16 17 18 |
# File 'lib/mountapi/schema/array.rb', line 13 def cast(array) raise_cast_error(array) unless array.is_a?(::Array) array.to_a.map do |item| Schema.build(open_api_schema.items).cast(item) end end |