Skip to content

[FEATURE]: HandyJSON can be supported in Swift language #2688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MQTwist opened this issue Mar 7, 2025 · 0 comments
Open

[FEATURE]: HandyJSON can be supported in Swift language #2688

MQTwist opened this issue Mar 7, 2025 · 0 comments

Comments

@MQTwist
Copy link

MQTwist commented Mar 7, 2025

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
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant