Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

When a payload has fields with mixed presence documenting those fields may still result in a failure due to undocumented fields

Aperta
#626 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@sharanggupta ci sta già lavorando.

Dal 6/10/2026.

  • #1064 di @sharanggupta — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java

Direzione di ricerca

Start by reproducing the JSON payload with the documented paths: count, items[].k1, and items[].k2[].name. Inspect the handling of documented fields and cascading removal of empty objects and arrays, then add coverage showing that both empty and populated items[].k2 entries are handled without an undocumented-field failure.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

type: bug

Taken from this question on Stack Overflow, consider the following JSON payload:

{
  "count": 2,
  "items": [
    {
      "k1": "v1",
      "k2": []
    },
    {
      "k1": "v2",
      "k2": [
        {
          "name": "joe"
        },
        {
          "name": "alice"
        }
      ]
    }
  ]
}

Documenting the following fields should be sufficient for the payload to be considered fully documented:

  • count
  • items[].k1
  • items[].k2[].name

Instead, REST Docs reports that items[].k2 has not been documented.

When items[].k2[].name is documented, it's removed from its containing object. The object then becomes empty and it's removed from its parent array. This parent array, items[].k2 then becomes empty so it is removed from items. This only works for the second items[].k2 entry in the payload. The first items[].k2 entry is unaffected because it's empty to begin with. As a result, there's no removal of the name entry to trigger the cascading removal of empty containers (objects or arrays).

Lingua principale
Java
Stelle
1.2k
Fork
733
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di spring-projects/spring-restdocs

Tutte le issue di spring-projects/spring-restdocs

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.