Uploaded image for project: 'Realm Cocoa SDK'
  1. Realm Cocoa SDK
  2. RCOCOA-1244

Cannot declare fields on Codable class without initial values

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Goals

      Declare a Decimal128 on my Realm Object.

      Expected Results

      Schema discovery should succeed. If I add default values, schema discovery is successful, but for many Codable types, this feels redundant.

      Actual Results

      @objcMembers class Account: Object, ObjectKeyIdentifiable, Codable {
          dynamic var currency: String
          dynamic var balance: Decimal128
          dynamic var id: String
      
          override class func primaryKey() -> String? {
              "id"
          }
      }
      


      Steps for others to Reproduce

      Declare the above model, open a Realm.

      Version of Realm and Tooling

      Realm framework version: 10.7.4

      Xcode version: 12.5

      iOS/OSX version: 14.5

            Assignee:
            lee.maguire@mongodb.com Lee Maguire
            Reporter:
            jason.flax@mongodb.com Jason Flax
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: