Class: Babl::Schema::FixedArray

Inherits:
Object
  • Object
show all
Defined in:
lib/babl/schema/fixed_array.rb

Constant Summary collapse

EMPTY =
new(Utils::Array::EMPTY)

Instance Method Summary collapse

Instance Method Details

#jsonObject



9
10
11
12
13
14
15
# File 'lib/babl/schema/fixed_array.rb', line 9

def json
    if items.empty?
        { enum: [Utils::Array::EMPTY] }
    else
        { type: 'array', items: items.map(&:json), additionalItems: false }
    end
end