[Schema Inaccuracy] "contents" endpoints response seem way under-specified
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- openapi, yaml
- 領域
- api
調査の方向性
issue に記載されている file-commit スキーマと content-file スキーマから始め、PUT および DELETE の contents endpoint のレスポンスと比較します。どのプロパティが一貫して存在するか、content が DELETE の場合のみ nullable か、また type に制約を設けるべきかを確認します。OpenAPI スキーマが両方のレスポンスバリアントと、それぞれの必須フィールドを正確に記述できていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The "updating "contents" endpoints (PUT, or DELETE on /repos/{owner}/{repo}/contents/{path}, but not GET) all respond with a file-commit defined thus:
file-commit:
title: File Commit
description: File Commit
type: object
required:
- content
- commit
properties:
content:
type: object
properties:
name:
type: string
path:
type: string
sha:
type: string
size:
type: integer
url:
type: string
html_url:
type: string
git_url:
type: string
download_url:
type: string
type:
type: string
_links:
type: object
properties:
self:
type: string
git:
type: string
html:
type: string
nullable: true
commit:
type: object
properties:
sha:
type: string
node_id:
type: string
url:
type: string
html_url:
type: string
author:
type: object
properties:
date:
type: string
name:
type: string
email:
type: string
committer:
type: object
properties:
date:
type: string
name:
type: string
email:
type: string
message:
type: string
tree:
type: object
properties:
url:
type: string
sha:
type: string
parents:
type: array
items:
type: object
properties:
url:
type: string
html_url:
type: string
sha:
type: string
verification:
type: object
properties:
verified:
type: boolean
reason:
type: string
signature:
type: string
nullable: true
payload:
type: string
nullable: true
So file-commit has two required properties content and commit, with the first being nullable.
It's my understanding that content is null in the case of DELETE, in the case of PUT it's present and contains the information of the just-created file.
However I don't understand in what case all the properties of a non-null content or a commit would be missing, surely most or all properties should be required, with the possible (probable?) exception of commit.verification?
All in all, file-commit.content looks like a slightly cut down version of content-file (without encoding and content), so probably should otherwise have the same schema? And for both it seems like the type field should be an enum with file as the only option?
I think file-commit.content could be something like a file type with content-file being an allOf(file, {encoding: ..., content: ...}) but I guess that increases the complexity of the schema and currently there's a single use site for allOf so that's probably a tad too much.
- 主要言語
- 言語のデータがありません
- スター
- 1.6k
- フォーク
- 342
- 平均マージ
- 2時間 23分
- マージ済み PR(30日)
- 57
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/rest-api-description のほかの issue
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
github/rest-api-description#7220 ·
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
github/rest-api-description#7201 ·
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/rest-api-description#7163 ·
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
github/rest-api-description#7162 ·
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
github/rest-api-description#7135 ·
github/rest-api-description の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
canonical/paas-charm#368 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
area:workflow bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
fil-donadoni/tolaria#4409 ·
-
status/awaiting_triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100