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

Portable schema IDs cascade from the root document digest, so any root edit rotates every ID in generated output

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
julia, openapi

調査の方向性

src/normalize.jl の _portable_schema_ids から始め、_content_digest、parent、pointer、keyword がそれぞれの label をどのように形成するかを追跡する。既存の衝突サフィックス処理を維持しつつ、無関係な root の編集によって external- IDs が変わらないようにする。IDs は決定的であり続け、参照先の schema が変わったときに変わるべきである。

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

説明

Generated clients embed a _SCHEMA_RESOURCE_DATA table keyed by https://openapi.invalid/schema/.json. The labels are content-derived, and the derivation chains every label back to the root document's digest. The practical effect is that editing one field anywhere in the root spec rotates every schema ID in the generated package. So for every update in the schemas the changes are massive in the autogenerated code.

The source of this problem is here

src/normalize.jl, _portable_schema_ids:

labels = Dict{Resources.ResourceId,String}(
primary.id => "root-" * first(_content_digest(primary.contents), 20),
)
...
seed = parent * "|" * pointer * "|" * keyword
labels[target] = "external-" * first(bytes2hex(SHA.sha256(seed)), 20)

_content_digest is sha256 over the canonical JSON of the whole root document, so it covers info.version, info.description, and every unrelated part of the spec.

Each external- label is then seeded on its parent label, which is the root label for first-level references and another derived label deeper down. So the root digest propagates transitively into every ID in the graph.

The fix entails decoupleing each label from the root digest, so an ID changes only when that schema changes:

  • Seed external- labels on the target resource's own _content_digest, rather than on the parent label. Collisions already have handling via the -2, -3 suffix loop in the remaining branch just below.
  • Or seed on the structural reference path from a stable root identifier (for example the spec's info.title) instead of the root's content hash.

Either keeps IDs stable under unrelated root edits while preserving determinism and uniqueness.

主要言語
Julia
スター
56
フォーク
16
平均マージ
1日 51分
マージ済み PR(30日)
12

環境構築

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

はじめの一歩

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

JuliaComputing/OpenAPI.jl のほかの issue

JuliaComputing/OpenAPI.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

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

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