-
Notifications
You must be signed in to change notification settings - Fork 136
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
Should return 204 for null entity from nullable single navigation property #288
Comments
Need to consider these cases: |
Now LINQ can not return different result when entity does not exist vs property value is empty, we will need additional query to differentiate 404 vs 204 return code, move it to backlog per internal discussion and will check whether there is a better way on this part. |
Jeff from Oregon Youth Authority has requested this item. |
code merged, close the issue. |
Thanks Petr Slavik for reporting this issue.
Here is what spec says:
11.2.6 Requesting Related Entities
To request related entities according to a particular relationship, the client issues a GET request to the source entity’s request URL, followed by a forward slash and the name of the navigation property representing the relationship.
If the navigation property does not exist on the entity indicated by the request URL, the service returns 404 Not Found.
If the relationship terminates on a collection, the response MUST be the format-specific representation of the collection of related entities. If no entities are related, the response is the format-specific representation of an empty collection.
If the relationship terminates on a single entity, the response MUST be the format-specific representation of the related single entity. If no entity is related, the service returns 204 No Content
Example 59: return the supplier of the product with ID=1 in the Products entity set
http://host/service/Products(1)/Supplier
Now RESTier returns 404 which is incorrect.
The text was updated successfully, but these errors were encountered: