quicktype
quicktype copied to clipboard
[FEATURE]: HandyJSON can be supported in Swift language
Context (Input, Language)
Input Format: Json Output Language: Swift
Description
I hope to support HandyJSON in Swift language, or support generating attributes from original fields without filtering '_'.
Input
{
"greeting_ad": "Welcome to quicktype!",
}
Current Output
import Foundation
// MARK: - BTWelcome
class BTWelcome {
var greetingAd: String?
init(greetingAd: String?) {
self.greetingAd = greetingAd
}
}
Hope to output
class BTWelcome: HandyJSON {
var greetingAd: String?
required public init() {
}
public func mapping(mapper: HelpingMapper) {
mapper <<< greetingAd <-- "greeting_ad"
}
Or output
import Foundation
// MARK: - BTWelcome
class BTWelcome {
var greeting_ad: String?
init(greeting_ad: String?) {
self.greeting_ad = greeting_ad
}
}