Skip to content

Commit

Permalink
chore: Remove explicit caller argument info on ThrowIfNull.
Browse files Browse the repository at this point in the history
  • Loading branch information
peombwa committed Oct 10, 2023
1 parent 36189d1 commit ff2841e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions src/lib/Helpers/ValidationHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ internal static void ValidateNullOrWhitespace(string parameterName, string? valu
throw new ArgumentNullException(parameterName, string.Format(ErrorMessage.FieldIsRequired, parameterName, parentName));
}

internal static void ValidateNullObject(string parameterName, object? value)
{
ArgumentNullException.ThrowIfNull(value, parameterName);
}

internal static void ValidateLength(string parameterName, string? value, int maxLength)
{
if (value?.Length > maxLength)
Expand Down
4 changes: 2 additions & 2 deletions src/lib/OpenAI/OpenAIPluginManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ private void Validate(OpenAIPluginManifest openAIPluginManifest)
ValidationHelpers.ValidateLength(nameof(DescriptionForModel), openAIPluginManifest.DescriptionForModel, 8000);

ValidationHelpers.ValidateNullOrWhitespace(nameof(SchemaVersion), openAIPluginManifest.SchemaVersion, nameof(OpenAIPluginManifest));
ValidationHelpers.ValidateNullObject(nameof(Auth), openAIPluginManifest.Auth);
ValidationHelpers.ValidateNullObject(nameof(Api), openAIPluginManifest.Api);
ArgumentNullException.ThrowIfNull(openAIPluginManifest.Auth);
ArgumentNullException.ThrowIfNull(openAIPluginManifest.Api);
ValidationHelpers.ValidateNullOrWhitespace(nameof(LogoUrl), openAIPluginManifest.LogoUrl, nameof(OpenAIPluginManifest));
ValidationHelpers.ValidateEmail(nameof(ContactEmail), openAIPluginManifest.ContactEmail, nameof(OpenAIPluginManifest));
ValidationHelpers.ValidateNullOrWhitespace(nameof(LegalInfoUrl), openAIPluginManifest.LegalInfoUrl, nameof(OpenAIPluginManifest));
Expand Down

0 comments on commit ff2841e

Please sign in to comment.