-
Notifications
You must be signed in to change notification settings - Fork 946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jsonEncodedString not deal Date type #271
Comments
@kjessup Are you keeping jsonEncodedString in it's current form or are you going to implement Foundation's JSONEncoder everywhere? |
It is recommended to use the String type |
It's not an issue of whether converted to a String. The issue is a feature request to automatically handle the Date type. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The jsonEncodedString not convert Date type,that make response by json with date type will fail.
like this code will return fail to js client
response.setHeader(.contentType, value: "application/json")
let d: [String:Any] = ["a":1, "b":0.1, "c": true, "d":[2, 4, 5, 7, 8],"f":Date()]
do{
try response.setBody(json: d)
}catch{
Hope add Date type convert in jsonEncodedString
The text was updated successfully, but these errors were encountered: