Skip to content

Commit 96bcc18

Browse files
committed
docs(readme): document client generated id option
1 parent 229b53c commit 96bcc18

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ JsonApiDotnetCore provides a framework for building [json:api](http://jsonapi.or
2626
- [Filtering](#filtering)
2727
- [Sorting](#sorting)
2828
- [Meta](#meta)
29+
- [Client Generated Ids](#client-generated-ids)
2930
- [Tests](#tests)
3031

3132
## Comprehensive Demo
@@ -342,6 +343,20 @@ public class Person : Identifiable<int>, IHasMeta
342343
}
343344
```
344345

346+
### Client Generated Ids
347+
348+
By default, the server will respond with a `403 Forbidden` HTTP Status Code if a `POST` request is
349+
received with a client generated id. However, this can be allowed by setting the `AllowClientGeneratedIds`
350+
flag in the options:
351+
352+
```csharp
353+
services.AddJsonApi<AppDbContext>(opt =>
354+
{
355+
opt.AllowClientGeneratedIds = true;
356+
// ..
357+
});
358+
```
359+
345360
## Tests
346361

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

0 commit comments

Comments
 (0)