Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Aug 23, 2024
1 parent 32415c7 commit 0bd3496
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/schema.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ function update_id(uri::URIs.URI, s::String)
end

function get_element(schema, path::AbstractString)
for element in split(path, "/"; keepempty = false)
elements = split(path, "/"; keepempty = true)
if isempty(first(elements))
popfirst!(elements)
end
for element in elements
schema = _recurse_get_element(schema, unescape_jpath(String(element)))
end
return schema
Expand Down
3 changes: 2 additions & 1 deletion src/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,8 @@ function _validate(
val::Number,
path::String,
)
if !isapprox(x / val, round(x / val))
y = x / val
if !isfinite(y) || !isapprox(y, round(y))
return SingleIssue(x, path, "multipleOf", val)
end
return
Expand Down

0 comments on commit 0bd3496

Please sign in to comment.