Rustango docs

ModelViewSet & OpenAPI

Five REST endpoints in a few lines, with a generated spec.

#[derive(ViewSet)] scaffolds list / create / retrieve / update / destroy with filtering, pagination, and permissions. Enable openapi and the serializers emit an OpenAPI 3.1 schema served behind Swagger UI / Redoc. Errors follow RFC 7807 Problem Details; collections can use the JSON:API envelope.

#[derive(ViewSet)]
#[viewset(model = Article, serializer = ArticleSerializer)]
pub struct ArticleViewSet;

// mounts GET/POST /articles, GET/PUT/DELETE /articles/{id}
New in 0.42

OpenAPI schemas are auto-derived from #[derive(Serializer)] types.