Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

enums doesn't workΒ #10

@MihaelIsaev

Description

@MihaelIsaev

I have codable model

struct Foo: Codable {
    enum Status: Int, Codable {
        case one, two, three, four, five
    }
    var statuses: [Status]
}

when I'm trying to send request to http://localhost:8080/users?statuses[]=1&statuses[]=2
I'm getting this error
[ ERROR ] URLEncodedFormError.convertible: Could not convert Status to form-urlencoded data.

Model below with just [Int] works as expected, so I guess that there's a bug with enums decoding

struct Foo: Codable {
    var statuses: [Int]
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions