Uploaded image for project: 'Swift'
  1. Swift
  2. SR-5431

JSON does not Encode/Decode subclass properties

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Duplicate
    • Component/s: Foundation
    • Labels:
      None
    • Environment:

      Xcode 9.0 beta. Swift 4. Mac OSX 10.12.5

      Description

      Using the simplest possible class structure and defaulting everything, subclass String properties are not encoded nor decoded. Base class properties no problem. Here is the class structure, the test code which demonstrates the problem is given as an attachment. This is a much simpler case than SR-4772 and SR-5125.

      class Product: Codable {
      var family: String = ""
      }
      class SubProduct: Product {
      var name: String = ""
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              JE Miller John E. Miller
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: