class FormDataExample::DocumentUploadSchema

Overview

Example 3: File upload form with validation

Defined in:

amber/schema/examples/form_data_example.cr

Class Method Summary

Instance Method Summary

Instance methods inherited from class Amber::Schema::Definition

errors : Array(Amber::Schema::Error) errors, parse : LegacyResult parse, raw_data : Hash(String, JSON::Any) raw_data, to_h : Hash(String, JSON::Any) to_h, validate : LegacyResult validate, validate_typed : Success(Hash(String, JSON::Any)) | Failure(Hash(String, JSON::Any)) validate_typed, validated_data : Hash(String, JSON::Any) | Nil validated_data

Constructor methods inherited from class Amber::Schema::Definition

new(raw_data : Hash(String, JSON::Any)) new

Class methods inherited from class Amber::Schema::Definition

additional_properties? : Bool additional_properties?, conditional_groups : Array(ConditionalGroup) conditional_groups, conditionals : Array(ConditionalGroup) conditionals, content_types : Array(String) content_types, field_names : Array(String) field_names, fields : Hash(String, FieldDef) fields, has_conditionals? : Bool has_conditionals?, has_field?(name : String) : Bool has_field?, nested_array_schemas : Hash(String, Definition.class) nested_array_schemas, nested_schemas : Hash(String, Definition.class) nested_schemas, required_field_names : Array(String) required_field_names, required_fields : Array(String) required_fields, requires_one_of_groups : Array(Array(String)) requires_one_of_groups, requires_together_groups : Array(Array(String)) requires_together_groups, source_blocks : Array(SourceBlock) source_blocks, uses_body_params? : Bool uses_body_params?, uses_header_params? : Bool uses_header_params?, uses_path_params? : Bool uses_path_params?, uses_query_params? : Bool uses_query_params?, validators : Array(Validator::Base) validators

Macros inherited from class Amber::Schema::Definition

additional_properties(allowed) additional_properties, content_type(*types) content_type, field(name, type, **options) field, from_body from_body, from_header from_header, from_path from_path, from_query from_query, nested(name, schema_class, **options) nested, requires_one_of(*fields) requires_one_of, requires_together(*fields) requires_together, validate(method_name = nil, &block) validate, validates_to(success_type, failure_type = ValidationError) validates_to, when_field(field, value, &block) when_field, when_present(field, &block) when_present

Class Method Detail

def self.additional_properties? #

Example 3: File upload form with validation


[View source]
def self.conditional_groups #

Example 3: File upload form with validation


[View source]
def self.content_types #

Example 3: File upload form with validation


[View source]
def self.failure_type #

Example 3: File upload form with validation


[View source]
def self.fields #

Example 3: File upload form with validation


[View source]
def self.nested_array_schemas #

Example 3: File upload form with validation


[View source]
def self.nested_schemas #

Example 3: File upload form with validation


[View source]
def self.required_fields #

Example 3: File upload form with validation


[View source]
def self.requires_one_of_groups #

Example 3: File upload form with validation


[View source]
def self.requires_together_groups #

Example 3: File upload form with validation


[View source]
def self.source_blocks #

Example 3: File upload form with validation


[View source]
def self.success_type #

Example 3: File upload form with validation


[View source]
def self.validators #

Example 3: File upload form with validation


[View source]

Instance Method Detail

def allow_downloads : Bool | Nil #

Store options in field definition Create getter for the field


[View source]
def attachments : Array(Hash(String, JSON::Any)) | Nil #

Create getter for the field


[View source]
def category : String | Nil #

Store options in field definition Create getter for the field


[View source]
def description : String | Nil #

Create getter for the field


[View source]
def is_public : Bool | Nil #

Store options in field definition Create getter for the field


[View source]
def primary_file : Hash(String, JSON::Any) | Nil #

Create getter for the field


[View source]
def tags : Array(String) | Nil #

Create getter for the field


[View source]
def thumbnail : Hash(String, JSON::Any) | Nil #

Create getter for the field


[View source]
def title : String | Nil #

Create getter for the field


[View source]