Skip to content

Commit

Permalink
Relaxing constraints for old password field that might be null.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisoelkers committed Jan 26, 2015
1 parent 6197a71 commit 7f2b5cc
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -22,17 +22,20 @@
import com.google.auto.value.AutoValue;
import org.hibernate.validator.constraints.NotEmpty;

import javax.annotation.Nullable;

@JsonAutoDetect
@AutoValue
public abstract class ChangePasswordRequest {
@JsonProperty
@Nullable
public abstract String oldPassword();

@JsonProperty
public abstract String password();

@JsonCreator
public static ChangePasswordRequest create(@JsonProperty("old_password") @NotEmpty String oldPassword,
public static ChangePasswordRequest create(@JsonProperty("old_password") @Nullable String oldPassword,
@JsonProperty("password") @NotEmpty String password) {
return new AutoValue_ChangePasswordRequest(oldPassword, password);
}
Expand Down

0 comments on commit 7f2b5cc

Please sign in to comment.