Data-swift / ManagedModels

A SwiftData like `@Model` infrastructure for CoreData.
https://www.alwaysrightinstitute.com/managedmodels/
Apache License 2.0
101 stars 3 forks source link

Optional Codable property fix #33

Closed admkopec closed 4 months ago

admkopec commented 4 months ago

This PR fixes a small issue with isOptional value of NSAttributeDescriptor which caused issues while saving entities with nil values for optional Codable properties, as described in issue #32.

This PR changes the return value of valueType getter to properly reflect isOptional for Any types when a base type and Objective-C class is not set. Additionally a test case was added to catch this issue during testing.