Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Schema Inaccuracy] `git-tree` schema has no required properties

Aperta
#3,833 1 commento 5 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
github, openapi
Ambito
api

Direzione di ricerca

Inizia individuando lo schema git-tree nella descrizione dell'API REST e ispeziona la sua proprietà tree e il relativo esempio. Confrontali con i campi obbligatori e i contenuti dell'esempio previsti dall'issue, quindi verifica che lo schema risultante produca i tipi downstream previsti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

documentation

Schema Inaccuracy

The tree property in the git-tree schema has no required fields. I believe this is inaccurate.

Additionally, the example field of the tree property appears to have incorrect data, as it includes a properties field and a required field. I'm guessing these were mistakenly copy/pasted at some point. My guess is that the required field from the example was intended to be in the tree property, making those fields required.

This matters to me because the downstream @octokit/openapi-types package that is generated from this definition lists every property as optional, forcing me to check for the existence of every single property on every single node.

Expected

  1. The path, mode, type, and sha fields should be required on the git-tree schema. (size appears to be absent on directories and submodules, and url appears to be absent on submodules)
  2. The properties and required fields should be removed from the git-tree schema's example.

Also, if you're feeling generous, you can update the types of type and mode to be enums, as laid out in #229 - it's the same exact schema!

Reproduction Steps

It's tough to prove that these properties will always be present, but I created this repo with every possible node type/mode combination, at least according to these docs. If you curl the tree for this repo, you'll see that every tree node has the path, mode, type and sha properties.

curl https://api.github.com/repos/rpmccarter/every-node-type/git/trees/main
Lingua principale
Nessun dato sulla lingua
Stelle
1.6k
Fork
342
Merge medio
2h 23m
PR unite (30g)
57

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/rest-api-description

Tutte le issue di github/rest-api-description

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.