Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Why does the JSON schema for 3.0 specify patternProperties for component names but allows additional properties?

未關閉
#3,720 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
json
領域
api

研究方向

從 3.0 JSON schema 開始,將其對元件名稱的處理方式與 versions/3.0.3.md 的固定欄位部分進行比較,然後查看討論 #2439 以了解其理由。完成的標準是記錄是否有意允許額外屬性,或確定需要對 schema/spec 進行的確切修正。

由索引模型根據 Issue 內容生成。

描述

bug Schema
Discussed in https://github.com/OAI/OpenAPI-Specification/discussions/2439

Originally posted by ryankinderman January 11, 2021
I've been working on some functionality that uses the JSON schema to help validate OpenAPI schemas, and recently noticed that the 3.0 schema allows any value for {name} in /components/{component}/{name}, while the specification states that "All the fixed fields declared above are objects that MUST use keys that match the regular expression: ^[a-zA-Z0-9\.\-_]+$." It seems like this could have been validated automatically by simply adding additionalProperties: false to the JSON schema.

My question is: Was not including additionalProperties: false in the JSON schema for 3.0 just an accidental omission, or was there some rationale behind not doing it?

Thanks for clarifying!

主要語言
Markdown
星號
31.2k
分支
9.2k
平均合併
2 天 9 小時
30 天內合併 PR
17

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

OAI/OpenAPI-Specification 的其他 Issue

查看 OAI/OpenAPI-Specification 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。