Migrating from v1
Migrating an app that uses Structure v1 to use Structure v2 requires some changes in the way validation errors are expected to be returned, default fallback of null values and upgrading Node (if you use a version lower than v10.13.0)
Validation errors
In v1, validations used to be like this:
Notice that the message used to contain only the name of the attribute (so if it's nested it will only show the attribute name of the nested structure) and the path is a string that use a dot .
to represent that it's a nested attribute.
If your app relies on the content of the message or the path, you'll have to consider that it's now returned like this:
In v2 the message contains the whole path for the attribute (using dot .
to represent it's a nested attribute) and the path is not an array.
Nullability and defaults
New public methods
So if any of your structures declare methods with these names you'll have to change it or it's gonna break.
Upgrade Node
Last updated
Was this helpful?