Closed
Description
Description
If you provide [HasOne] or [HasMany] attribute, self and related links are presented by default.
Example:
{
"type": "articles",
"id": "4309",
"relationships": {
"author": {
"links": {
"self": "/api/v1/articles/4309/relationships/author",
"related": "/api/v1/articles/4309/author"
}
}
}
}
To turn them off, now it's necessary to provide extra parameter - [HasOne(documentLinks: Link.None)].
To turn them off globaly, there should be something like:
options.DefaultRelationshipLinks = Link.None;
With output:
{
"type": "articles",
"id": "4309",
"relationships": {
"author": { }
}
}
}
Environment
- JsonApiDotNetCore Version: 3.0.0