Skip to content

Commit 4cb6672

Browse files
committed
docs(readme): document sparse fieldset support
1 parent 743edd1 commit 4cb6672

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ JsonApiDotnetCore provides a framework for building [json:api](http://jsonapi.or
2828
- [Meta](#meta)
2929
- [Client Generated Ids](#client-generated-ids)
3030
- [Custom Errors](#custom-errors)
31+
- [Sparse Fieldsets](#sparse-fieldsets)
3132
- [Tests](#tests)
3233

3334
## Comprehensive Demo
@@ -397,6 +398,23 @@ public override async Task<IActionResult> PostAsync([FromBody] MyEntity entity)
397398
}
398399
```
399400

401+
### Sparse Fieldsets
402+
403+
We currently support top-level field selection.
404+
What this means is you can restrict which fields are returned by a query using the `fields` query parameter, but this does not yet apply to included relationships.
405+
406+
- Currently valid:
407+
```http
408+
GET /articles?fields[articles]=title,body HTTP/1.1
409+
Accept: application/vnd.api+json
410+
```
411+
412+
- Not yet supported:
413+
```http
414+
GET /articles?include=author&fields[articles]=title,body&fields[people]=name HTTP/1.1
415+
Accept: application/vnd.api+json
416+
```
417+
400418
## Tests
401419

402420
I am using DotNetCoreDocs to generate sample requests and documentation.

0 commit comments

Comments
 (0)