This version is in beta. Some features may change before release.

REST plugin

Auto-generated JSON CRUD from your models - plus authentication, permissions, filtering, pagination.

umbral-rest walks the model registry and mounts a JSON CRUD surface for every model you've registered. Add the plugin, get /api/<table>/ on List + Retrieve + Create + Update + Delete, plus filtering, free-text search, FK expansion (?include=), sparse fieldsets (?fields=), pagination, and an OpenAPI spec everything else (the playground UI, code generators, third-party clients) reads from.

Code
rust
use umbral::prelude::*;
 
App::builder()
.model::<Article>()
.plugin(umbral_rest::RestPlugin::default())
.build()?;
// → GET/POST/PATCH/PUT/DELETE under /api/article/

The full surface lives in the REST section:

  • Overview - what gets generated, customising responses, custom actions
  • Authentication - SessionAuthentication, BearerAuthentication, ChainAuthentication, writing your own
  • Permissions - AllowAny, IsAuthenticated, IsStaff, ReadOnly, OrPermission / AndPermission, writing your own
  • Throttling - AnonRateThrottle, UserRateThrottle, ScopedRateThrottle, the rate string + 429/Retry-After
  • Versioning - opt-in URL-path (/api/v1/...) and accept-header (Accept; version=v2) schemes, allowed/default versions
  • Bulk endpoints - opt-in .bulk() create / update / delete, transactional all-or-nothing, max-batch cap, same permissions + denylist as single-object

The plugin contract itself is documented in arch.md; the rest/ folder above covers the everyday consumer surface.