Generated schemas keep OpenAPI `nullable`, so required-but-nullable fields reject null
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- github, javascript, openapi
- 領域
- api, build-system, tooling
調査の方向性
script/build-schemaから始めて、GitHub OpenAPIスナップショットの選択方法を確認し、そのソースをdescriptions-next/と比較します。schema/dereferenced/settings.jsonを再生成し、issueに示されているnullable設定を検証します。required_status_checksとrestrictionsが、nullableに依存せずdraft 2020-12でnullを受け入れれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The schemas in schema/dereferenced/ declare "$schema": "https://json-schema.org/draft/2020-12/schema", but script/build-schema copies subschemas out of GitHub's OpenAPI 3.0 description, which marks null-able fields with nullable: true. That keyword doesn't exist in JSON Schema draft 2020-12, so any compliant validator ignores it and the fields reject null.
This bites exactly where the GitHub API forces null into configs. The update-branch-protection endpoint requires required_status_checks, enforce_admins, and restrictions to be present, and documents "Set to null to disable". A minimal config:
branches:
- name: main
protection:
required_status_checks: null
enforce_admins: true
restrictions: null
fails validation against the current schema/dereferenced/settings.json:
$.branches[0].protection.required_status_checks: None is not of type 'object'
$.branches[0].protection.restrictions: None is not of type 'object'
There are 13-14 nullable: true occurrences per generated file, all silently dropped this way.
GitHub publishes an OpenAPI 3.1 variant of the same spec (descriptions-next/, same dated snapshots). 3.1 is natively JSON Schema 2020-12: those fields are type: [X, "null"] unions and nullable doesn't exist. Pointing the build at it makes the generated schemas actually conform to the dialect they declare, with no post-processing.
- 主要言語
- JavaScript
- スター
- 922
- フォーク
- 227
- 平均マージ
- 7日 20時間
- マージ済み PR(30日)
- 1
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github-community-projects/safe-settings のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
Bug Report: environment and repo variables API calls don't paginate, failing with more than 10 itemsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
github-community-projects/safe-settings の issue をすべて見る
似ている issue
-
Complexity: Small P-Feature: Projects page ready for merge team role: back end/devOps role: front end size: 0.25pt
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 67/100
bellingcat/toolkit#905 ·
-
self-care self-care:docs-build-time-investigator
難易度 2/5 半日 初心者へのやさしさ 76/100
githubnext/gh-aw-cao#14191 ·
メンテナーはふだん 1 日以内に返信
-
effort:low impact:medium RAG status: auto-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
mastra-ai/mastra#25229 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
sugarlabs/musicblocks#8984 ·
メンテナーはふだん 1 日以内に返信