[Schema Inaccuracy] "contents" endpoints response seem way under-specified
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- openapi, yaml
- Ambito
- api
Direzione di ricerca
Inizia con gli schemi file-commit e content-file descritti nell’issue, quindi confrontali con le risposte degli endpoint PUT e DELETE contents. Determina quali proprietà sono presenti in modo coerente, se content è nullable solo per DELETE e se type debba essere vincolato. Il lavoro è completato quando gli schemi OpenAPI descrivono accuratamente entrambe le varianti di risposta e i relativi campi obbligatori.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/rest-api-description
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
github/rest-api-description#7220 ·
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
github/rest-api-description#7201 ·
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
github/rest-api-description#7163 ·
-
Runner deprecations: registration_deprecates_at is declared on the response but never returned Apertafeature
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
github/rest-api-description#7162 ·
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
github/rest-api-description#7135 ·
Tutte le issue di github/rest-api-description
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
canonical/paas-charm#368 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
area:workflow bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
fil-donadoni/tolaria#4409 ·
-
status/awaiting_triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100