[Schema Inaccuracy] "contents" endpoints response seem way under-specified
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- openapi, yaml
- Área
- api
Línea de trabajo
Comienza con los esquemas file-commit y content-file descritos en la issue y compáralos después con las respuestas de los endpoints PUT y DELETE contents. Determina qué propiedades están presentes de forma coherente, si content solo puede ser nullable para DELETE y si type debería estar restringido. Se considera terminado cuando los esquemas de OpenAPI describan correctamente ambas variantes de respuesta y sus campos obligatorios.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 1.6k
- Forks
- 342
- Merge medio
- 2 h 23 min
- PR fusionados (30 d)
- 57
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/rest-api-description
-
feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
github/rest-api-description#7220 ·
-
feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
github/rest-api-description#7201 ·
-
feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
github/rest-api-description#7163 ·
-
Runner deprecations: registration_deprecates_at is declared on the response but never returned Abiertofeature
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
github/rest-api-description#7162 ·
-
feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
github/rest-api-description#7135 ·
Todos los issues de github/rest-api-description
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
canonical/paas-charm#368 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
tech debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
area:workflow bug ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
fil-donadoni/tolaria#4409 ·
-
status/awaiting_triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100