# Setup
using Legolas
using Legolas: SchemaVersion, @schema, @version
using Tables
@schema "foo" Foo
@version FooV1 begin
a::Vector
b::AbstractString
c::Int32
d::Int32
end
f = FooV1SchemaVersion()
t = Tables.Schema((:a, :b), (Int32, Float64))
Legolas.validate(t, f)
main:
julia> Legolas.validate(t, f)
ERROR: ArgumentError: field `a` has unexpected type; expected <:Vector, found Int32
Stacktrace:
[1] validate(ts::Tables.Schema{(:a, :b), Tuple{Int32, Float64}}, sv::SchemaVersion{:foo, 1})
@ Legolas ~/Code/Legolas.jl/src/schemas.jl:285
[2] top-level scope
@ REPL[8]:1
This branch:
julia> Legolas.validate(t, f)
ERROR: ArgumentError: Tables.Schema violates Legolas schema `foo@1`:
- Could not find required field: `c`
- Could not find required field: `d`
- Incorrect type: `a` expected `<:Vector`, found `Int32`
- Incorrect type: `b` expected `<:AbstractString`, found `Float64`
Provided Tables.Schema:
:a Int32
:b Float64
(Note: was updated following review feedback below)
Close #56.
main
:This branch:
(Note: was updated following review feedback below)
Punch list: