Skip to content
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

Need to consider whether types with subattributes should show attributes that are "null" or not #90

Open
justingaylor opened this issue Nov 20, 2014 · 2 comments
Milestone

Comments

@justingaylor
Copy link
Contributor

When rendering types with subattributes, we need to decide whether subattributes that are nil should be returned or not.

We currently return them:

{
  "timestamps": {
    "created_at": "2014-11-20T20:41:12+00:00",
    "updated_at": "2014-11-20T20:43:22+00:00",
    "deleted_at": null
  }
}
@careo
Copy link
Contributor

careo commented Nov 20, 2014

I hit a number of other... quirks... with nil subattributes with the praxis plugins as well. So there's definitely some tweaking needed around them.

@shaley91
Copy link

shaley91 commented Dec 9, 2014

I have already spoken to @justingaylor and @careo about an issue when using attributor with PATCH calls.

For Example
We have an update call that uses PATCH instead of PUT.

So for example if I have a resource called User which has the attributes:

============
name: String
email: String

If I wanted to just update the name I could call PATCH /user/:id, { name: 'updated_name' } and leave out the email attribute.
But what happens is that attributor/praxis detect that the email isn't there and add it to the payload.
So the request comes through like this: { name: 'updated_name', email: nil }.

@careo careo added this to the v2.5 milestone Jan 20, 2015
@careo careo modified the milestones: v2.5, v5.0 Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants