-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Labels
Description
The JSONAPI spec recommends using dasherized keys
http://jsonapi.org/recommendations/#naming
However, that breaks with jsonapi-utils.
jsonapi-resources 0.7
jsonapi-utils (~> 0.4.5)
With a request such as this:
{
"data": {
"id": "58",
"type": "doctor-family-members",
"links": {
"self": "http://localhost:3000/doctor-family-members/58"
},
"attributes": {
"doctor-id": 14,
"family-member-id": 5,
"min-visits": 2000,
"avg-extra-visits": 3000,
"doctor-name": "MATTHEW PARSONS"
},
"relationships": {
"doctor": {
"links": {
"self": "http://localhost:3000/doctor-family-members/58/relationships/doctor",
"related": "http://localhost:3000/doctor-family-members/58/doctor"
}
},
"family-member": {
"links": {
"self": "http://localhost:3000/doctor-family-members/58/relationships/family-member",
"related": "http://localhost:3000/doctor-family-members/58/family-member"
}
}
}
}
}
a param method of:
params.require(:data).require(:attributes).permit(:min_visits, :avg_extra_visits)
Shows min-visits and avg-extra-visits as not permitted.