When an endpoint method takes a model where optional fields are not set, the method should avoid including the field altogether in the JSON request body. There might be a semantic difference between excluding a field and including it, but having its value be null. In order to not make assumptions about this difference, this pull request makes it so unset fields are excluded when sending requests.
Until all harborapi's endpoint methods have been thoroughly tested with a live Harbor instance, all this is just conjecture, but for now it seems like a reasonable assumption, hence proceeding with this change.
Tests
Most POST/PUT tests did not expect that fields could be omitted, and they have been changed accordingly.
When an endpoint method takes a model where optional fields are not set, the method should avoid including the field altogether in the JSON request body. There might be a semantic difference between excluding a field and including it, but having its value be
null
. In order to not make assumptions about this difference, this pull request makes it so unset fields are excluded when sending requests.Until all
harborapi
's endpoint methods have been thoroughly tested with a live Harbor instance, all this is just conjecture, but for now it seems like a reasonable assumption, hence proceeding with this change.Tests
Most POST/PUT tests did not expect that fields could be omitted, and they have been changed accordingly.