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

Partial update skip required field validation

Aperta
#4,516 11 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
django, python
Ambito
api, backend

Direzione di ricerca

Inizia riproducendo un aggiornamento parziale in cui un campo obbligatorio viene fornito come valore vuoto o null con allow_null abilitato. Poiché nell’issue non sono indicati file o test, segui il punto di ingresso della validazione del serializer e aggiungi una copertura che dimostri che i valori vuoti forniti vengono gestiti come previsto senza modificare il comportamento dei campi omessi.

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

Descrizione

Documentation stale

Checklist

  • I have verified that that issue exists against the master branch of Django REST framework.
  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • This is not a usage question. (Those should be directed to the discussion group instead.)
  • This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where possible.)
  • I have reduced the issue to the simplest possible case.
  • I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)

Hello, first thanks for this great piece code.
I am referring to the issue ##1725 because it still seems like a bug to me even in version 3.x.

Steps to reproduce

If a partial update is performed and a field marked as required is passed with a an empty value (even null if allow_null is set to true) the validation passes.

Expected behavior

In my humble opinion, required fields should be checked and validated as such even in partial update, if they are passed in the payload.

Actual behavior

The required fields are saved with the passed value even if empty and even null if allow_null is set to true.

Lingua principale
Python
Stelle
30.2k
Fork
7.1k
Merge medio
2g 12m
PR unite (30g)
20

Guida per i contributori

Apri la guida per i contributori

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 encode/django-rest-framework

Tutte le issue di encode/django-rest-framework

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.