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

flatten: replace redirectSchemaRefs reflection with kin's SchemaRef.WalkSubtree

Abierto
#1,239 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go
Área
devtools

Línea de trabajo

First check whether the go.mod dependency on getkin/kin-openapi resolves to a release containing getkin/kin-openapi#1267 (SchemaRef.WalkSubtree); the issue explicitly forbids swapping before that. Then locate redirectSchemaRefs (introduced by #1233, the self-referential identity repair after MergeSpec) and replace it with the s.WalkSubtree callback sketched in the issue. Verify coverage against the two-object-cycle fixtures and the tests added for #1233, confirming the repointed ref's subtree is still reached despite the walker's *Schema seen-guard, then run the full go test suite.

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

Descripción

#1233 repairs self-referential identity after MergeSpec's write-back with redirectSchemaRefs, a reflection-driven walk over the merged subtree. Reflection was chosen because no exported per-schema walker existed: kin's WalkSchemas starts at the document, and its subtree descent is unexported.

That walker now exists upstream: getkin/kin-openapi#1267 adds SchemaRef.WalkSubtree (same descent, cycle guard, and SkipSubtree semantics as WalkSchemas, scoped to one schema), fixes three subschema keywords the descent was missing (unevaluatedItems, unevaluatedProperties, contentSchema), and adds a type-driven completeness gate so a new Schema field cannot be silently skipped.

Once a kin release carrying #1267 is picked up, replace redirectSchemaRefs with a WalkSubtree callback:

_ = s.WalkSubtree(func(_ string, ref *openapi3.SchemaRef) error {
    if ref.Value == m {
        ref.Value = s.Value
    }
    return nil
})

(One nuance to verify at swap time: the walker's seen-guard dedups by *Schema, and the repair must still reach a repointed ref's subtree; the current reflection walk recurses into the redirected target, so the replacement should confirm equivalent coverage on the two-object-cycle fixtures.)

The traversal's field list then lives in kin, next to the Schema type it enumerates, maintained once for every consumer — the reason the reflection version was always an interim. Do not swap before the kin dependency is on a release containing #1267.

Lenguaje dominante
Go
Estrellas
1.4k
Forks
109
Merge medio
12 h 11 min
PR fusionados (30 d)
35

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 oasdiff/oasdiff

Todos los issues de oasdiff/oasdiff

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.