Skip to content

Account for null avatar_url values

Ben Morgan requested to merge drbenmorgan/rust-gitlab:null-user-avatar into master

Under certain Gitlab configurations (here, CERN's instance, 11.0.5) the value of the user/project avatar_url key may be null. As the structs using this expect a String instance, deserialisation fails.

Here, the structs using avatar_url have been updated to consistently use Option<String> per other values that may be null. Tests have also been updated to compare values against Option<String> s.

Cargo tests have been confirmed to pass, and checks using this patch on a ghostflow instance connected to the CERN gitlab instance resolves the deserialisation issue.

Merge request reports