quicktype icon indicating copy to clipboard operation
quicktype copied to clipboard

[FEATURE]: HandyJSON can be supported in Swift language

Open MQTwist opened this issue 7 months ago • 0 comments

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
    }
}

MQTwist avatar Mar 07 '25 10:03 MQTwist