Formatting
I can't deal with code that isn't formatted anymore.
Tests
Get back to 100% code coverage (or as near to it as possible). There is currently a bunch of untested code.
Code style
There are many isa when we can use dispatch. Here's one example:
|
function Schema(spec) |
|
spec_obj = spec isa Object ? spec : Object{String, Any}(spec) |
|
return Schema{Any}(Any, spec_obj, nothing) |
|
end |
I don't know what the point of this part is
|
elseif T === Int || T === Int64 || T === Int32 || T === Int16 || T === Int8 || |
|
T === UInt || T === UInt64 || T === UInt32 || T === UInt16 || T === UInt8 || |
|
T <: Integer |
Surely it's just T <: Integer
Split schema validation and schema generation
There are really two separate things here. The current file is a bit confusing to me
The validation code
v2 has changed how we structure the validation code. I used to use dispatch to separate out each thing in the schema:
|
### |
|
### Core JSON Schema |
|
### |
|
|
|
# 9.2.1.1 |
|
function _validate(x, schema, ::Val{:allOf}, val::AbstractVector, path::String) |
|
for v in val |
|
ret = _validate(x, v, path) |
|
if ret !== nothing |
|
return ret |
|
end |
|
end |
|
return |
|
end |
This made it easy to reason about what parts of the schema were covered and not. I think it's a shame to loose that.
Formatting
I can't deal with code that isn't formatted anymore.
Tests
Get back to 100% code coverage (or as near to it as possible). There is currently a bunch of untested code.
Code style
There are many
isawhen we can use dispatch. Here's one example:JSONSchema.jl/src/schema.jl
Lines 70 to 73 in 3c5bb85
I don't know what the point of this part is
JSONSchema.jl/src/schema.jl
Lines 302 to 304 in 3c5bb85
Surely it's just
T <: IntegerSplit schema validation and schema generation
There are really two separate things here. The current file is a bit confusing to me
The validation code
v2 has changed how we structure the validation code. I used to use dispatch to separate out each thing in the schema:
JSONSchema.jl/src/validation.jl
Lines 138 to 151 in 3e01774
This made it easy to reason about what parts of the schema were covered and not. I think it's a shame to loose that.