Sha256: 5ce00f3ebc2b59dcf2d7e6145fcd735f10026e8e18ef850766583420025c41b6
Contents?: true
Size: 904 Bytes
Versions: 40
Compression:
Stored size: 904 Bytes
Contents
# list object loader class OpenAPIParser::SchemaLoader::ListLoader < OpenAPIParser::SchemaLoader::Creator # @param [OpenAPIParser::Schemas::Base] target_object # @param [Hash] raw_schema # @return [Array<OpenAPIParser::Schemas::Base>, nil] def load_data(target_object, raw_schema) create_attr_list_object(target_object, raw_schema[ref_name_base.to_s]) end private def create_attr_list_object(target_object, array_schema) unless array_schema variable_set(target_object, variable_name, nil) return end data = array_schema.map.with_index do |s, idx| ref = build_object_reference_from_base(target_object.object_reference, [ref_name_base, idx]) build_openapi_object_from_option(target_object, ref, s) end variable_set(target_object, variable_name, data) data end alias_method :ref_name_base, :schema_key end
Version data entries
40 entries across 40 versions & 2 rubygems