Note: this guide assumes you are upgrading from decanter v1 to v3. In order to migrate from v2, please downgrade to v1 first.
This version contains the following breaking changes:
strict true
mode will now raise exceptions for unhandled keys.
strict true
previously displayed warnings rather than raising exceptions. To adapt to the new behavior, replace all instances of strict true
in your app with strict false
, and replace all instances of strict :with_exception
to strict true
.
JoinParser
andKeyValueSplitterParser
default parsers have been removed.
If you use these parsers in your project, you should include them as custom parsers. Their source code is available on the v1
branch.
- All default parsers (except for
ArrayParser
) now strictly require a single value.
Default parsers will now raise an exception when passed an array of values. For instance, an attribute declared with input <name>, :string
will expect to receive a single string rather than an array of strings. Previously, default parsers handled arrays of values in unstable and undocumented ways. In the (unlikely) event that your project was relying on the previous behavior, you can include the legacy version(s) of the parsers as custom parsers in your project.
- Decanter exceptions have been renamed from
Decanter::Core::<Exception>
toDecanter::<Exception>
.
If your project relies on specific decanter exception names, make sure to rename those instances accordingly.