Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Generated schemas keep OpenAPI `nullable`, so required-but-nullable fields reject null

Abierto
#1,024 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@tdabasinskas ya está trabajando en esto.

Desde el 11/7/2026.

  • #1025 de @tdabasinskas — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
github, javascript, openapi

Línea de trabajo

Empieza por script/build-schema e inspecciona cómo selecciona la instantánea de GitHub OpenAPI; después compara esa fuente con descriptions-next/. Regenera schema/dereferenced/settings.json y valida la configuración nullable mostrada en la issue; se considera terminado cuando required_status_checks y restrictions acepten null con draft 2020-12 sin depender de nullable.

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

Descripción

bug

The schemas in schema/dereferenced/ declare "$schema": "https://json-schema.org/draft/2020-12/schema", but script/build-schema copies subschemas out of GitHub's OpenAPI 3.0 description, which marks null-able fields with nullable: true. That keyword doesn't exist in JSON Schema draft 2020-12, so any compliant validator ignores it and the fields reject null.

This bites exactly where the GitHub API forces null into configs. The update-branch-protection endpoint requires required_status_checks, enforce_admins, and restrictions to be present, and documents "Set to null to disable". A minimal config:

branches:
  - name: main
    protection:
      required_status_checks: null
      enforce_admins: true
      restrictions: null

fails validation against the current schema/dereferenced/settings.json:

$.branches[0].protection.required_status_checks: None is not of type 'object'
$.branches[0].protection.restrictions: None is not of type 'object'

There are 13-14 nullable: true occurrences per generated file, all silently dropped this way.

GitHub publishes an OpenAPI 3.1 variant of the same spec (descriptions-next/, same dated snapshots). 3.1 is natively JSON Schema 2020-12: those fields are type: [X, "null"] unions and nullable doesn't exist. Pointing the build at it makes the generated schemas actually conform to the dialect they declare, with no post-processing.

Lenguaje dominante
JavaScript
Estrellas
924
Forks
227
Merge medio
6 h 8 min
PR fusionados (30 d)
15

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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-community-projects/safe-settings

Todos los issues de github-community-projects/safe-settings

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.