Join GitHub today
Parameters of "type: string" reject numeric values as "malformed" #184
In the latest version and earlier. The following simple fragment when generated as a route will only allow alpha-numeric values to be passed in the request.
For example: using a numeric value is rejected as "The query parameter 'a' was malformed: String"
referenced this issue
Feb 25, 2019
@dsilvasc I honestly haven't had a chance to circle around and fix the underlying bug here. I'd rather this not be the case, but for now I can't offer a better solution.
What needs to happen is the underlying types from swagger need to be reflected in akka-http's directives (
Right now, we're just taking everything as a string, attempting to parse it as JSON, then treating it as a string before proceeding. This creates an unfortunate situation where if a valid JSON symbol (numbers, boolean literals) are supplied, they'll get parsed as those literals, failing the string decoder. This has the additional unfortunate impact of removing surrounding double quotes from strings, as they're parsed as JSON string literals.