[Feature Request] Side-Posting in automatic REST API
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- typescript
- Área
- api
Línea de trabajo
Start from the automatic REST API's POST handling path (the code that serves the generated REST endpoints) and its existing test suite, since the payload names no files. The example JSON request is the acceptance case: a POST with data plus included should create the primary resource and the lid-linked related resource atomically. Trace how the request body is parsed and relationships resolved to decide where lid resolution and the included array belong, then add a test covering the sample payload. Done means that single request creates both records, with no partial write on failure.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
Currently, ZenStack's automatic REST API handles single-resource creation effectively. However, when building complex frontends (especially those using JSON:API standards), there is often a need to create a primary entity along with several related "child" entities in a single atomic HTTP request.
Without support for Local IDs (lid) and the included section for writable operations, developers must:
- Issue multiple sequential requests.
- Manage temporary client-side IDs.
- Handle partial failures (where the parent is created but children fail), which complicates transaction management on the frontend.
Describe the solution you'd like
I would like the ZenStack REST API to support "side-posting" by recognizing the lid (Local ID) and included attributes during a POST request. This would allow a single request to create a resource and its related resources simultaneously by linking them via a temporary local identifier.
Key Requirements:
- LID Support: Support
lidas a temporary identifier within therelationshipsandincludedblocks to link resources that don't have a server-generated ID yet. - Side-posting in
included: The API should parse theincludedarray in aPOSTrequest and treat those objects as resources to be created alongside the primary data. - Atomic Operations (Next Step): Ideally, this should pave the way for full support of the JSON:API Atomic Operations extension, allowing multiple independent operations in one transaction.
Example Payload:
{
"data": {
"type": "articles",
"attributes": { "title": "New Article" },
"relationships": {
"author": { "data": { "type": "people", "lid": "temp-author-1" } }
}
},
"included": [
{
"type": "people",
"lid": "temp-author-1",
"attributes": { "name": "Jane Doe" }
}
]
}
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.9k
- Forks
- 157
- Merge medio
- 2 d 46 min
- PR fusionados (30 d)
- 17
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de zenstackhq/zenstack
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
zenstackhq/zenstack#2873 ·
Los mantenedores suelen responder en 1 día
-
`@default` on a field of a `@map`-ed enum emits the enum name as the column defaultPosiblemente ocupada @jkugsiya la tomó hace 4 días. Abiertoruntime
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
zenstackhq/zenstack#2868 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
zenstackhq/zenstack#2694 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
zenstackhq/zenstack#2659 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
zenstackhq/zenstack#2542 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de zenstackhq/zenstack
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
anomalyco/opencode#56380 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
BUG | `MCP 服务器` | 全局层行的停用/启用与删除报 404 server row not found,编辑保存会在 profile 层复制出重复行Posiblemente ocupada @w6242652 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Chocobozzz/PeerTube#7832 ·
Los mantenedores suelen responder en 3 días
-
Pay to use?Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 66/100
darkreader/darkreader#16108 · 1 comentario ·
Los mantenedores suelen responder en 2 días