alibaba / alibaba/HandyJSON

为啥toJSON方法转字典后,并不是自己创建的属性名

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

Description

var wId : String? = ""

override func mapping(mapper: HelpingMapper) {
mapper <<<
self.wId <-- "id"
}

toJSON之后获取的key是“id”而不是wId,这么玩的吗

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the mapping snippet in the issue and trace how toJSON chooses the output key after mapper << self.wId <-- "id". Compare the mapped key with the Swift property name and check existing serialization tests or examples. Done means the intended key behavior is established and covered by a reproducible test.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.