[Schema Inaccuracy] verification.verified_at marked as required but not present in API response

Abierto
#4,995 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
json, openapi
Área
api

Línea de trabajo

Comienza en api.github.com.2022-11-28.json e inspecciona las properties y el array required del esquema Verification. Compáralo con los objetos verification devueltos por los endpoints commits y git commits descritos en el issue. Se considera terminado cuando el esquema coincide con la respuesta documentada de la API y los clientes generados ya no rechazan una respuesta que no incluya verified_at.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

documentation

Schema Inaccuracy

The verification schema incorrectly lists verified_at as a required field, but GitHub's API does not return this field in the actual response. This causes validation errors in generated client libraries that strictly enforce the schema.

Expected

The verified_at property in the verification schema should either:

  1. Be removed from the required array (since it's not actually returned by the API), or
  2. Be removed entirely from the schema properties if it's not part of the API response

Current schema definition in api.github.com.2022-11-28.json:

{
  "title": "Verification",
  "type": "object",
  "properties": {
    "verified": {
      "type": "boolean"
    },
    "reason": {
      "type": "string"
    },
    "payload": {
      "type": "string",
      "nullable": true
    },
    "signature": {
      "type": "string",
      "nullable": true
    },
    "verified_at": {
      "type": "string",
      "nullable": true
    }
  },
  "required": [
    "verified",
    "reason",
    "payload",
    "signature",
    "verified_at"  // <-- This field is not returned by the API
  ]
}

Reproduction Steps

  1. Make a request to get commit details with verification information:
$ curl -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  https://api.github.com/repos/OWNER/REPO/commits/COMMIT_SHA
  1. Observe the actual verification object returned:
{
  "sha": "example_sha",
  "commit": {
    "message": "Example commit message",
    "author": {...},
    "verification": {
      "verified": false,
      "reason": "unsigned",
      "signature": null,
      "payload": null
      // Note: No "verified_at" field is present
    }
  }
}
  1. The same issue occurs when using the git commits endpoint:
$ curl -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  https://api.github.com/repos/OWNER/REPO/git/commits/COMMIT_SHA

Impact

This schema inaccuracy causes validation errors in strongly-typed client libraries generated from the OpenAPI specification. For example, Python libraries using Pydantic validation will fail with:


pydantic.error_wrappers.ValidationError: 1 validation error for Verification
verified_at
field required (type=value_error.missing)
Lenguaje dominante
Sin datos de lenguaje
Estrellas
1.6k
Forks
342
Merge medio
3 h 33 min
PR fusionados (30 d)
51

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de github/rest-api-description

Todos los issues de github/rest-api-description

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.