MIT licensed by Felix Paulusma
Maintained by [email protected]
This version can be pinned in stack with:safe-json-1.1.3.1@sha256:722cab97d924ba6190b4d8c13a0b18dab72a5772b865773b80c9ad2970925797,4013

Module documentation for 1.1.3.1

This library aims to make the updating of JSON formats or contents, while keeping backward compatibility, as painless as possible. The way this is achieved is through versioning and defined migration functions to migrate older (or newer) versions to the one used.

The library mainly consists of two classes:

  • SafeJSON a: Defines the version of a and if (and how) it is migratable.

  • Migrate a: Defines the data type (MigrateFrom a) that can be migrated to a and how to migrate from that type.

Using these two classes, JSON serialized data types will stay parsable, even after format changes.

For a more in-depth explanation and examples, please see the README at https://github.com/Vlix/safe-json#readme

Changes

Changelog for safe-json

1.1.3.1

  • Compatibility with GHC 9.2.*, and time < 0.13

1.1.3.0

  • Compatibility with aeson < 2.1 and text < 2.1 #33 Thanks to @ysangkok
  • Compatibility with bytestring < 0.12.

1.1.2.0

1.1.1.1

  • loosened dependecy restriction on tasty
  • fixed some documentation

1.1.1

  • Fix clash in test/Instances.hs of Ord instance for Data.Aeson.Value #23

1.1.0

  • update for GHC 8.8.1 #15
    • loosened dependency restriction on time
    • fixed instance for IntMap
  • DRY-er TestMigrate and TestReverseMigrate type synonyms #17 Thanks to @blinkytoy
  • fixed documentation #17 Thanks to @blinkytoy
    • broken links to modules
    • setVersion’s documentation only showing half

1.0.0

  • Removed FromJSON/ToJSON dependecy on SafeJSON
    • Default implementation of safeFrom and safeTo unchanged, still require FromJSON and ToJSON
  • Added unsafe setVersion and removeVersion functions.
  • Integrated Data.SafeJSON.Instances into Data.SafeJSON.Internal
  • Some documentation cleanup/fixes
  • Added convenience functions for defining safeFrom and safeTo
    • e.g. containWithObject, (.:$), (.=$), etc.

0.1.0

  • First release. Includes:
    • Data.Aeson.Safe
    • Data.SafeJSON
    • Data.SafeJSON.Instances
    • Data.SafeJSON.Internal
    • Data.SafeJSON.Test