Skip to content

Commit deffca8

Browse files
committed
Renamed class
1 parent 791e286 commit deffca8

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/Microsoft.OpenApi/Validations/OpenApiValidationError.cs renamed to src/Microsoft.OpenApi/Validations/OpenApiValidatorError.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ public enum ErrorReason
3535
/// <summary>
3636
/// Errors detected when validating a OpenAPI Element
3737
/// </summary>
38-
public class OpenApiValidationError : OpenApiError
38+
public class OpenApiValidatorError : OpenApiError
3939
{
4040
/// <summary>
4141
/// Initializes the <see cref="OpenApiError"/> class.
4242
/// </summary>
43-
public OpenApiValidationError(ErrorReason reason, string pointer, string message) : base(pointer, message)
43+
public OpenApiValidatorError(ErrorReason reason, string pointer, string message) : base(pointer, message)
4444
{
4545
Pointer = pointer;
4646
Message = message;
@@ -50,7 +50,7 @@ public OpenApiValidationError(ErrorReason reason, string pointer, string message
5050
/// <summary>
5151
/// Initializes the <see cref="OpenApiError"/> class.
5252
/// </summary>
53-
public OpenApiValidationError(string ruleName, string pointer, string message) : base(pointer, message)
53+
public OpenApiValidatorError(string ruleName, string pointer, string message) : base(pointer, message)
5454
{
5555
Pointer = pointer;
5656
Message = message;

src/Microsoft.OpenApi/Validations/ValidationExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static class ValidationContextExtensions
2020
/// </summary>
2121
public static void CreateError(this IValidationContext context, string ruleName, ErrorReason reason, string message)
2222
{
23-
OpenApiValidationError error = new OpenApiValidationError(reason, context.PathString, message);
23+
OpenApiValidatorError error = new OpenApiValidatorError(reason, context.PathString, message);
2424
error.RuleName = ruleName;
2525
context.AddError(error);
2626
}

test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiDocumentTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void ParseBrokenMinimalDocumentShouldYieldExpectedDiagnostic()
109109
{
110110
Errors =
111111
{
112-
new OpenApiValidationError(nameof(OpenApiInfoRules.InfoRequiredFields),"#/info/title", "The field 'title' in 'info' object is REQUIRED.")
112+
new OpenApiValidatorError(nameof(OpenApiInfoRules.InfoRequiredFields),"#/info/title", "The field 'title' in 'info' object is REQUIRED.")
113113
},
114114
SpecificationVersion = OpenApiSpecVersion.OpenApi3_0
115115
});

test/Microsoft.OpenApi.Tests/Services/OpenApiValidatorTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void ResponseMustHaveADescription()
5757
validator.Errors.ShouldBeEquivalentTo(
5858
new List<OpenApiError>
5959
{
60-
new OpenApiValidationError(ErrorReason.Required, "#/paths/~1test/get/responses/200/description",
60+
new OpenApiValidatorError(ErrorReason.Required, "#/paths/~1test/get/responses/200/description",
6161
String.Format(SRResource.Validation_FieldIsRequired, "description", "response"))
6262
{
6363
RuleName = "ResponseRequiredFields"
@@ -92,7 +92,7 @@ public void ServersShouldBeReferencedByIndex()
9292
validator.Errors.ShouldBeEquivalentTo(
9393
new List<OpenApiError>
9494
{
95-
new OpenApiValidationError(ErrorReason.Required, "#/servers/1/url",
95+
new OpenApiValidatorError(ErrorReason.Required, "#/servers/1/url",
9696
String.Format(SRResource.Validation_FieldIsRequired, "url", "server"))
9797
{
9898
RuleName = "ServerRequiredFields"
@@ -112,7 +112,7 @@ public void ValidateCustomExtension()
112112
{
113113
if (item.Bar == "hey")
114114
{
115-
context.AddError(new OpenApiValidationError(ErrorReason.Format, context.PathString, "Don't say hey"));
115+
context.AddError(new OpenApiValidatorError(ErrorReason.Format, context.PathString, "Don't say hey"));
116116
}
117117
}));
118118

@@ -138,7 +138,7 @@ public void ValidateCustomExtension()
138138
validator.Errors.ShouldBeEquivalentTo(
139139
new List<OpenApiError>
140140
{
141-
new OpenApiValidationError(ErrorReason.Format, "#/info/x-foo", "Don't say hey")
141+
new OpenApiValidatorError(ErrorReason.Format, "#/info/x-foo", "Don't say hey")
142142
});
143143
}
144144

test/Microsoft.OpenApi.Tests/Validations/OpenApiResponseValidationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void ValidateDescriptionIsRequiredInResponse()
3131
// Assert
3232
Assert.False(result);
3333
Assert.NotNull(errors);
34-
OpenApiValidationError error = Assert.Single(errors) as OpenApiValidationError;
34+
OpenApiValidatorError error = Assert.Single(errors) as OpenApiValidatorError;
3535
Assert.Equal(String.Format(SRResource.Validation_FieldIsRequired, "description", "response"), error.Message);
3636
Assert.Equal(ErrorReason.Required, error.ReasonClass);
3737
Assert.Equal("#/description", error.Pointer);

0 commit comments

Comments
 (0)