Skip to content

generic type with transformersByPropertyKey #4

@Jenus

Description

@Jenus

`public protocol BaseResponse : JSONCodable {
var statusCode:Int{get}
var statusmessage:String?{get}
var success:Bool?{get}

}
public struct PrimitiveResponse : BaseResponse {
public var status : Int = 0
public var succeeded:Bool?
public var message:String?
public var data:T?

// public static let transformersByPropertyKey: [PropertyKey: JSONTransformer] = [
// "status" : "statusCode",
// "succeeded" : "success"
// ]
}`

!!! compiler comes out the error "Static stored properties not supported in generic types"
Btw, this editor ignored the key part [ "< T : JSONCodable >" ].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions