Skip to content

Release 3.0.0

Choose a tag to compare

@deankarn deankarn released this 31 Jul 00:50
· 34 commits to master since this release

What's new?

  • Added Embedded struct support
  • Added omitempty just like std lib JSON

Made a version bump to v3.0.0 because the new Embedded struct logic has the potential to affect existing clients.

The Encoder has a new option SetAnonymousMode(...) by default it embeds anonymous struct info as if the fields were part of the containing struct itself; to continue to have it split out the Embedded structs just set mode to AnonymousSeparate and it will function exactly as previous versions.

please see examples detailing new functionality.

NOTE: if a struct and embedded struct have the same field, this will decode the value into both fields as there is no way to tell which you want; decoding into only the Embedded struct is still supported, again see examples.

Thanks to @danielchatfield and @michael2m for creating issues to get these features on the radar 👍