Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional Codable property issue #32

Closed
admkopec opened this issue May 9, 2024 · 1 comment
Closed

Optional Codable property issue #32

admkopec opened this issue May 9, 2024 · 1 comment
Assignees

Comments

@admkopec
Copy link
Contributor

admkopec commented May 9, 2024

After dropping CodableBox a new issue arose when declaring entity attribute as an optional codable type. The NSAttributeDescription's isOptional value is set to false, which is invalid and results in "NSLocalizedDescription=%{PROPERTY}@ is a required value., NSValidationErrorKey=optionalSip, NSValidationErrorValue=null" error upon save when the attribute value is nil.

@admkopec
Copy link
Contributor Author

admkopec commented May 9, 2024

I was able to quickly isolate the issue to the getter of valueType. When no attributeValueClassName is present, then this getter returns Any. But it should return Any or Any? depending on value of isOptional.

I'll try to make a quick PR for this.

admkopec added a commit to admkopec/ManagedModels that referenced this issue May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant