From f7eee4fb528866e16e98e0cc5deeb6ba7d04574d Mon Sep 17 00:00:00 2001 From: odow Date: Fri, 23 Aug 2024 12:19:27 +1200 Subject: [PATCH] Update --- src/schema.jl | 6 +++++- src/validation.jl | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/schema.jl b/src/schema.jl index 343a065..23edf29 100644 --- a/src/schema.jl +++ b/src/schema.jl @@ -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 diff --git a/src/validation.jl b/src/validation.jl index 86fb7e7..ac9de73 100644 --- a/src/validation.jl +++ b/src/validation.jl @@ -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