Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Because the EntityAPI returns false when we do not have an entity to pass to it, we return a 401. I think it would be better to follow the node resource paradigm of returning an empty 200 OK for a non-existant entity. Patch attached returns TRUE when $entity_type = 'user', $entity is empty and $op = view.
Comment | File | Size | Author |
---|---|---|---|
#4 | uuid-1959276-services-user-4.patch | 1.18 KB | skwashd |
Comments
Comment #1
jpstrikesback CreditAttribution: jpstrikesback commentedAny thoughts on this?
Comment #2
skwashd CreditAttribution: skwashd commentedIf a user doesn't exist we should return 404 (not found) as the entity doesn't exist. 200 suggests everything is OK, which it isn't. 401 doesn't make sense either.
btw how does the stock services module handle this?
Comment #3
jpstrikesback CreditAttribution: jpstrikesback commentedHey @skywashd apologies for the rather long delay in replying :P
Here is what services does in _user_resource_access():
Comment #4
skwashd CreditAttribution: skwashd commentedAttached is a patch that returns a 406.
Comment #5
skwashd CreditAttribution: skwashd commentedThe passed this, so it is in.