mitchellhanberg.com

Encoding Ecto Validation Errors in Phoenix 1.3 (opens in new tab)

From Mitchell Hanberg's Blog: # Problem I recently ran into this error while implementing the first endpoint of my Phoenix JSON API. After a bit of googling and detective work, I found the offending piece of code, located in my `error_view.ex` file. This function handles rendering the JSON payload that the controller sends back to the client when there is an error. The `errors` property of the `changeset` struct is a keyword list* of `error`'s, with `error` being a type defined in the Changes...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help