Closed solnic closed 1 year ago
Introduce Drops.Type with:
Drops.Type
:string
:integer
Drops.Type.Sum
Drops.Type.List
:list
member_type
Drops.Type.Schema
Schema
Now a schema looks like this:
contract.schema() #=> %Drops.Type.Schema{ primitive: :map, constraints: [predicate: {:type?, :map}], keys: [ %Drops.Type.Schema.Key{ path: [:age], presence: :required, type: %Drops.Type{ primitive: :integer, constraints: [predicate: {:type?, :integer}] } }, %Drops.Type.Schema.Key{ path: [:name], presence: :required, type: %Drops.Type{ primitive: :string, constraints: [predicate: {:type?, :string}] } } ], atomize: false }
Introduce
Drops.Type
with:Drops.Type
- primitive types list:string
,:integer
etc.Drops.Type.Sum
- composition of two typesDrops.Type.List
- a:list
type with amember_type
Drops.Type.Schema
- previousSchema
module converted into a standard built-in typeNow a schema looks like this: