alibaba / alibaba/HandyJSON

带有date日期属性的模型self.toJSON() 再JSONSerialization.data(withJSONObject: dic, options: [.prettyPrinted])崩溃

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

Description

模型转字典,再序列化崩溃,是因为不支持date属性序列化,请问toJson()这个方法不会自动将date属性的值字符串化么?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the model's self.toJSON() entry point and reproduce the crash with JSONSerialization.data(withJSONObject:options: [.prettyPrinted]) using a model with a Date property. Trace how the Date value is represented and define done as serialization completing without the reported crash; no file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.