class Dry::Schema::Macros::Schema

def define(*args, &block)

Other tags:
    Api: - private
def define(*args, &block)
  definition = schema_dsl.new(&block)
  schema = definition.call
  type_schema =
    if array?
      parent_type.of(definition.type_schema)
    elsif redefined_schema?(args)
      parent_type.schema(definition.types)
    else
      definition.type_schema
    end
  final_type = optional? ? type_schema.optional : type_schema
  type(final_type)
  if schema.filter_rules?
    schema_dsl[name].filter { hash?.then(schema(schema.filter_schema)) }
  end
  schema
end