[Schema Inaccuracy] "contents" endpoints response seem way under-specified
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 38/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- openapi, yaml
- Domínio
- api
Direção de pesquisa
Comece pelos schemas file-commit e content-file descritos na issue e, em seguida, compare-os com as respostas dos endpoints PUT e DELETE contents. Determine quais propriedades estão presentes de forma consistente, se content é nullable apenas para DELETE e se type deve ser restringido. Considera-se concluído quando os schemas OpenAPI descreverem corretamente ambas as variantes de resposta e seus campos obrigatórios.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Sem dados de linguagem
- Estrelas
- 1.6k
- Forks
- 347
- Merge médio
- 2h 1min
- PRs com merge (30d)
- 80
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de github/rest-api-description
-
feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
github/rest-api-description#7286 ·
Mantenedores costumam responder em até 1 dia
-
feature
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
github/rest-api-description#7266 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
github/rest-api-description#7246 ·
Mantenedores costumam responder em até 1 dia
-
feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
github/rest-api-description#7220 ·
Mantenedores costumam responder em até 1 dia
-
feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
github/rest-api-description#7201 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de github/rest-api-description
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 91/100
FujiNetWIFI/fujinet-firmware#2045 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
paperclipai/paperclip#16785 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
Mantenedores costumam responder em até 1 dia
-
bug status: needs triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
mastra-ai/mastra#27538 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
webrecorder/warcio#209 ·