elm-todo-rest-api icon indicating copy to clipboard operation
elm-todo-rest-api copied to clipboard

json-server casts int-like strings to int

Open buhman opened this issue 6 years ago • 0 comments

If you create a todo like this:

POST /todos

{
  "title": "1234",
  …
}

The response will be:

{
  "title": 1234,
  …
}

This breaks the todoDecoder, which expects title to be a string. Even more confusingly, the Result.Err from FetchAllDone and CreateDone are discarded as well. Maybe consider reporting upstream and/or making a more type-friendly API.

buhman avatar Oct 25 '17 09:10 buhman