alibaba / alibaba/HandyJSON

继承自 NSManagedObject 的对象无法解析

Open
#407 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
4.3k
Forks
677
PR merge metrics
No merged PRs in 30d

Description

```swift
@objc(OAuthModel)
final class OAuthModel: NSManagedObject, HandyJSON {
@NSManaged public var access_token: String?
}

let dic: [String : Any] = [
"access_token" : "78491447f77ca068a6211b7bf5aff725",
]

let model = try? OAuthModel.deserialize(from: dic)
print(model!.access_token ?? "null")
```

如上代码,继承自 NSManagedObject 的对象,解析后,属性为 nil

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with the OAuthModel and dictionary shown in the report, then trace HandyJSON's deserialization path for NSManagedObject subclasses. Done means the deserialized OAuthModel has the supplied access_token value instead of nil, with regression coverage for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.