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

Empty Links collection returns null _links #11

Closed
jasonmitchell opened this issue Oct 30, 2018 · 0 comments
Closed

Empty Links collection returns null _links #11

jasonmitchell opened this issue Oct 30, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@jasonmitchell
Copy link
Owner

Expected behaviour is that no "_links" property is included in the response body when a null or empty Links collection is returned from a LinksFor implementation.

For example, given the following method:

public IEnumerable<Link> LinksFor(Person resource)
{
    return new Link[0];
}

The response will include a null "_links" property like below:

{
  "id": 1,
  "firstName": "Geoffrey",
  "lastName": "Merrill",
  "_links": null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant