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

Could not convert Decimal to form-urlencoded data.Β #11

@oxycoder

Description

@oxycoder

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request

Current behavior

Could not convert Decimal to form-urlencoded data. (Logger+LogError.swift:17)

Expected behavior

Decimal value from request

Minimal reproduction of the problem with instructions

struct ProductRequest: Content {
    var prices: [Decimal]
}
_ = try req.content.decode(ProductRequest.self).map(to: Product.self) { postData in

}
curl -X POST \
  http://localhost:8080/product \
  -H 'Accept: application/json' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Postman-Token: 430b8984-a57f-4aec-9d40-ec772a8d2f86' \
  -d 'prices[]=10000.0&prices[]=20000.0'

Environment

Vapor Toolbox: 3.1.7
Vapor Framework: 3.0.5
MacOS 10.13.5
XCode 9.4.1

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