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

flatten: allOf silently drops 3.1-specific schema keywords

Abierto
#878 0 comentarios 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
60/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
go
Área
api

Línea de trabajo

Start in flatten/allof/merge_allof.go and read how the existing MinItems/MaxItems and type-conflict logic merges subschemas. Pick one of the easy items, such as Const or MinContains/MaxContains, and add its merge rule following that pattern. Check docs/ALLOF.md for the documented field list. Done means the keyword is merged or reports a conflict, with a test covering it.

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

Descripción

enhancement

Follow-up to #868 / #873.

flatten/allof/merge_allof.go doesn't reference any 3.1-specific schema keyword introduced by JSON Schema 2020-12. Every one of the 18 keywords below is silently dropped from the merged schema today — same class of bug as the numeric exclusiveMinimum / exclusiveMaximum issue that #873 just fixed.

Verified by grepping each field name against flatten/allof/merge_allof.go on main after #873 merge — zero references for all of them.

Easy — mirror existing patterns

Small, mechanical fixes. Land each in its own PR (or in one small batch).

  • Const — must be equal across subschemas; conflict if not (mirrors existing type-conflict logic). High priority — likely to appear in real specs.
  • MinContains / MaxContains — mirrors MinItems / MaxItems (most-restrictive wins).
  • ContentMediaType / ContentEncoding — string equality, conflict if mismatched.
  • DependentRequired — union of map[string][]string entries.
  • $defs (Defs in kin-openapi) — copy/merge by name.

Medium — schema-valued, need recursive merge

  • Contains / PropertyNames — single *SchemaRef; the conjunction is the merged schema of all subschemas' values.
  • PatternProperties / DependentSchemas — Schemas map; merge by key with recursive merge on value collisions.
  • PrefixItems — SchemaRefs slice; merge position-by-position.

Hard — semantics don't compose cleanly

For these, we should decide at the product level whether flatten errors out (safer) or silently approximates (today's behavior, but the result may be misleading).

  • If / Then / Else — conditional logic; the conjunction of two if/then/else schemas can't be expressed as a single if/then/else in general.
  • UnevaluatedItems / UnevaluatedProperties — semantics depend on which sibling keywords were considered "evaluating"; merging changes that context.

Out of scope

A few non-3.1 fields are also not merged today (XML, ExternalDocs, Example, Deprecated, AllowEmptyValue) and are documented as such in docs/ALLOF.md. Those are a separate decision.

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.