Skip to content

Commit 229b53c

Browse files
committed
feat(jsonapi-controller): allow client generated ids if configured
1 parent 8534691 commit 229b53c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JsonApiDotNetCore/Controllers/JsonApiController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public virtual async Task<IActionResult> PostAsync([FromBody] T entity)
138138
return UnprocessableEntity();
139139
}
140140

141-
if (!string.IsNullOrEmpty(entity.StringId))
141+
if (!_jsonApiContext.Options.AllowClientGeneratedIds && !string.IsNullOrEmpty(entity.StringId))
142142
return Forbidden();
143143

144144
await _entities.CreateAsync(entity);

0 commit comments

Comments
 (0)