joukevandermaas / saule

JSON API library for ASP.Net Web API 2.
https://joukevandermaas.github.io/saule
MIT License
76 stars 37 forks source link

Do not serialize "data" on a relationship when the relationship value is null #180

Closed zeWizard closed 6 years ago

zeWizard commented 6 years ago

Hey man,

love this library it is awesome.

Just wanted to submit a potential change. To not serialize the "data" on a relationship when that relationship was null. Just referring to this part of the standard (http://jsonapi.org/format/#document-resource-object-relationships) "A “relationship object” MUST contain at least one of the following:".

Cheers Trent