autorest
autorest copied to clipboard
change summary on validate method
The generated code says the Validate method throw ArgumentException, but that is not true.
/// <summary>
/// Validate the object. Throws ArgumentException or ArgumentNullException if validation fails.
/// </summary>
public virtual void Validate()
{
if (Id == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Id");
}
}
note: ValidateException doesn't inherit from ArgumentException nor ArgumentNullException.
Let me know if I can provide a PR to this.
Good catch! If you can submit a PR that would be great.
What is the proposed fix? To update the comment or change Validate to throw ArgumentNullException/ArgumentException? The latter would better follow the principle of least surprise.