Skip to content

SwiftEmbed 1.2.0

Choose a tag to compare

@sdfsdhgjkbmnmxc sdfsdhgjkbmnmxc released this 21 Aug 19:17
· 16 commits to main since this release

Breaking Changes

  • Bundle is now the first parameter without label
  • Removed default Bundle.main - must be explicit

New API

// Property wrappers
@Embedded.json(Bundle.main, path: "file.json")
@Embedded.yaml(Bundle.module, path: "file.yaml")

// Direct loading
Embedded.getJSON(Bundle.main, path: "file.json", as: [User].self)
Embedded.getYAML(Bundle.module, path: "file.yaml", as: Config.self)

Migration

Change from:

  • @Embedded.json("file.json", bundle: Bundle.module)
  • Embedded.getJSON("file.json", bundle: Bundle.module, as: T.self)

To:

  • @Embedded.json(Bundle.module, path: "file.json")
  • Embedded.getJSON(Bundle.module, path: "file.json", as: T.self)