Add test for REST API GET/PUT round-trip #3714
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #DNE
What's Changed
Testing idea that came out of a recent code review (I don't recall the specific one) - make sure the REST API is round-trip capable, i.e. that a client can GET an object, make any (or none) desired changes to the returned object, and send it back in via a PUT without needing to do any massaging of the object data to make it acceptable.
I've implemented this as a generic API test case, and fixed a number of issues it uncovered:
{value: X, label: Y}
but didn't support this format on write.Interface.mac_address
andVMInterface.mac_address
are nullable, but the API wasn't permitting a client to sendnull
values for these fields.DeviceType.front_image
andDeviceType.rear_image
similarly are nullable but were not marked as such in the API.User.password
was incorrectly marked as a required API field on write.TODO