Actions
Issue #6908
closedNullable DB fields cannot be set to null via the API
Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version - Debian:
Platform Release:
Target Release - Debian:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:
Description
I noticed this while working with remotes, but it may well affect other things as well.
Stepos to reproduce:
- Create an example remote:
http post :/pulp/api/v3/remotes/deb/apt/ name=tuxedo_remote distributions="bionic" components="main"architectures="i386 amd64" url="http://deb.tuxedocomputers.com/ubuntu/"
- Try to update the components to null:
$ http patch :/pulp/api/v3/remotes/deb/apt/<uuid>/ components:=null --json HTTP/1.1 400 Bad Request Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS Connection: keep-alive Content-Length: 46 Content-Type: application/json Date: Thu, 04 Jun 2020 11:55:12 GMT Server: nginx/1.14.2 Vary: Accept, Cookie X-Frame-Options: SAMEORIGIN { "components": [ "This field may not be null." ] }
Note that it is perfectly legal to create the remote with the null field by simply omitting that option. Functionally it makes perfect sense to change your mind about this later. It should be allowed to null such nullable fields!
Updated by pulpbot over 4 years ago
- Status changed from NEW to POST
Added by msinghal over 4 years ago
Updated by msinghal over 4 years ago
- Status changed from POST to MODIFIED
Applied in changeset 61f8a1704a54c59cdff1868865b1095e1cb6bdb8.
Updated by quba42 over 3 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions
Fix nullable DB fields which could not be set to null via the API
fixes #6908 https://pulp.plan.io/issues/6908