Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Feature Request] Side-Posting in automatic REST API

オープン
#2,373 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
typescript
領域
api

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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" }
    }
  ]
}
主要言語
TypeScript
スター
2.9k
フォーク
157
平均マージ
11時間 42分
マージ済み PR(30日)
20

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

zenstackhq/zenstack のほかの issue

zenstackhq/zenstack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。