HandyJSON Object properties returning nil with mappers

dzhpxtsq  于 5个月前  发布在  其他
关注(0)|答案(1)|浏览(129)

I have this code below

import Foundation
import HandyJSON

class SignedS3URL: BaseModel {
    var uploadUrl:UploadURLDetails?
    var isPublic:Bool?
    var filename:String?
    var url:String?
    var s3Key:String?
}

class Fields: BaseModel {
    var x_amz_algorithm:String?
    var policy:String?
    var acl:String?
    var content_type:String?
    var x_amz_signature:String?
    var x_amz_credential:String?
    var x_amz_date:String?
    var x_amz_meta_videoid:String?
    var x_amz_security_token:String?
    var key:String?
    
    required init() {}
    
    func mapping(mapper: HelpingMapper) {
        mapper <<<
            self.x_amz_algorithm <-- "x-amz-algorithm"
        mapper <<<
            self.content_type <-- "Content-Type"
        mapper <<<
            self.x_amz_signature <-- "x-amz-signature"
        mapper <<<
            self.x_amz_credential <-- "x-amz-credential"
        mapper <<<
            self.x_amz_date <-- "x-amz-date"
        mapper <<<
            self.x_amz_meta_videoid <-- "x-amz-meta-videoid"
        mapper <<<
            self.x_amz_security_token <-- "x-amz-security-token"
    }
}

class UploadURLDetails: BaseModel {
    var url:String?
    var fields:Fields?
}

but values in mapper returns nil, any help or suggextion?

相关问题