autodocodec-yaml 0.4.0.2 → 0.4.0.3
raw patch · 4 files changed
+25/−6 lines, 4 filesdep ~autodocodecdep ~autodocodec-schemaPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: autodocodec, autodocodec-schema
API changes (from Hackage documentation)
Files
- CHANGELOG.md +6/−0
- autodocodec-yaml.cabal +4/−4
- src/Autodocodec/Yaml/Encode.hs +1/−1
- src/Autodocodec/Yaml/Schema.hs +14/−1
CHANGELOG.md view
@@ -1,5 +1,11 @@ # Changelog +## [0.4.0.3] - 2026-07-14++### Changed++* Lower bound on `autodocodec >=0.6`+ ## [0.4.0.2] - 2025-06-20 ### Changed
autodocodec-yaml.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.36.1.+-- This file has been generated from package.yaml by hpack version 0.38.3. -- -- see: https://github.com/sol/hpack name: autodocodec-yaml-version: 0.4.0.2+version: 0.4.0.3 synopsis: Autodocodec interpreters for yaml homepage: https://github.com/NorfairKing/autodocodec#readme bug-reports: https://github.com/NorfairKing/autodocodec/issues@@ -34,8 +34,8 @@ hs-source-dirs: src build-depends:- autodocodec >=0.5.0.0- , autodocodec-schema >=0.2.0.1+ autodocodec >=0.6.0.0+ , autodocodec-schema >=0.2.0.2 , base >=4.7 && <5 , bytestring , containers
src/Autodocodec/Yaml/Encode.hs view
@@ -34,7 +34,7 @@ go a = \case NullCodec -> Yaml.null BoolCodec _ -> Yaml.bool (coerce a :: Bool)- StringCodec _ -> Yaml.string (coerce a :: Text)+ StringCodec _ _ -> Yaml.string (coerce a :: Text) IntegerCodec _ _ -> Yaml.scientific $ fromInteger (coerce a :: Integer) NumberCodec _ _ -> yamlNumber (coerce a :: Scientific) ArrayOfCodec _ c -> Yaml.array (map (`go` c) (V.toList (coerce a :: Vector _)))
src/Autodocodec/Yaml/Schema.hs view
@@ -137,7 +137,7 @@ AnySchema -> [[fore yellow "<any>"]] NullSchema -> [[fore yellow "null"]] BoolSchema -> [[fore yellow "<boolean>"]]- StringSchema -> [[fore yellow "<string>"]]+ StringSchema bounds -> stringBoundsChunks bounds IntegerSchema bounds -> integerBoundsChunks bounds NumberSchema _ -> [[fore yellow "<number>"]] -- TODO bounds? ArraySchema s ->@@ -160,6 +160,19 @@ WithDefSchema defs (RefSchema _) -> concatMap (\(name, s') -> [fore cyan $ chunk $ "def: " <> name] : goValue s') (M.toList defs) WithDefSchema defs s -> concatMap (\(name, s') -> [fore cyan $ chunk $ "def: " <> name] : goValue s') (M.toList defs) ++ goValue s where+ stringBoundsChunks :: StringBounds -> [[Chunk]]+ stringBoundsChunks sb =+ [ fore yellow "<string>" : case (stringBoundsMinLength sb, stringBoundsMaxLength sb) of+ (Nothing, Nothing) -> []+ (Just l, Nothing) ->+ [" # ", fore green $ chunk $ T.pack $ "at least " <> show l <> " characters"]+ (Nothing, Just u) ->+ [" # ", fore green $ chunk $ T.pack $ "at most " <> show u <> " characters"]+ (Just l, Just u) ->+ [ " # ",+ fore green $ chunk $ T.pack $ "between " <> show l <> " and " <> show u <> " characters"+ ]+ ] integerBoundsChunks :: Bounds Integer -> [[Chunk]] integerBoundsChunks nb = [ fore yellow "<integer>" : case guessIntegerBoundsSymbolic nb of