Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Feature Request] Side-Posting in automatic REST API

Abierto
#2,373 0 comentarios 1 reacción 0 asignados Ver en GitHub

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:

  1. Issue multiple sequential requests.
  2. Manage temporary client-side IDs.
  3. 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 lid as a temporary identifier within the relationships and included blocks to link resources that don't have a server-generated ID yet.
  • Side-posting in included: The API should parse the included array in a POST request 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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de zenstackhq/zenstack

Todos los issues de zenstackhq/zenstack

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.