Sha256: 3a30e393ac610b9f6b00bdc085976914b28d1f4d33c0bf776189e0ed42c880e0
Contents?: true
Size: 550 Bytes
Versions: 40
Compression:
Stored size: 550 Bytes
Contents
# frozen_string_literal: true module Cocina module Generator # Class for generating from an openapi array class SchemaArray < SchemaBase def generate "attribute :#{name.camelize(:lower)}, Types::Strict::Array.of(#{array_of_type})#{omittable}" end def omittable if required '.default([].freeze)' else '.meta(omittable: true)' end end def array_of_type schema_doc.items.name || "Types::#{dry_datatype(schema_doc.items)}" end end end end
Version data entries
40 entries across 40 versions & 1 rubygems