Skip to content

Can this be combined with json struct decoding and encoding struct to json? #110

@piersonleo

Description

@piersonleo

For example I have this struct and json string

struct Foo: Codable{
    var v: BigInt
}

let jsonString = "{\"v\": 410100000008994450000000000}"

I had tried to decode it but I got this error. So I created this post to confirm.

typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "v", intValue: nil)], debugDescription: "Expected to decode Array<Any> but found a number instead.", underlyingError: nil))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions