git.iko.soy/typeable/openapi3
on master help sign in
Fix the error message when using exclusiveMinimum/exclusiveMaximum (#15)
a2d1509Kenzo Yotsuya
src/Data/OpenApi/Internal/Schema/Validation.hs+2−2
@@ -315,11 +315,11 @@ validateNumber n = withConfig $ \_cfg -> withSchema $ \sch -> do
315
315
316 check maximum_ $ \m ->
316 check maximum_ $ \m ->
317 when (if exMax then (n >= m) else (n > m)) $
317 when (if exMax then (n >= m) else (n > m)) $
318− invalid ("value " ++ show n ++ " exceeds maximum (should be " ++ if exMax then "<" else "<=" ++ show m ++ ")")
318+ invalid ("value " ++ show n ++ " exceeds maximum (should be " ++ (if exMax then "<" else "<=") ++ show m ++ ")")
319
319
320 check minimum_ $ \m ->
320 check minimum_ $ \m ->
321 when (if exMin then (n <= m) else (n < m)) $
321 when (if exMin then (n <= m) else (n < m)) $
322− invalid ("value " ++ show n ++ " falls below minimum (should be " ++ if exMin then ">" else ">=" ++ show m ++ ")")
322+ invalid ("value " ++ show n ++ " falls below minimum (should be " ++ (if exMin then ">" else ">=") ++ show m ++ ")")
323
323
324 check multipleOf $ \k ->
324 check multipleOf $ \k ->
325 when (not (isInteger (n / k))) $
325 when (not (isInteger (n / k))) $