Skip to content

Commit 52661d5

Browse files
committed
fix: remove redudant rule
1 parent d6cfd92 commit 52661d5

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

src/ByteBard.AsyncAPI/Validation/Rules/AsyncApiServerRules.cs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
[AsyncApiRule]
77
public static class AsyncApiServerRules
88
{
9-
[AsyncApiVersionRule(AsyncApiVersion.AsyncApi3_0)]
109
public static ValidationRule<AsyncApiServer> ServerRequiredFields =>
1110
new ValidationRule<AsyncApiServer>(
1211
(context, server) =>
@@ -29,32 +28,6 @@ public static class AsyncApiServerRules
2928
string.Format(Resource.Validation_FieldRequired, "protocol", "server"));
3029
}
3130

32-
context.Exit();
33-
});
34-
35-
[AsyncApiVersionRule(AsyncApiVersion.AsyncApi2_0)]
36-
public static ValidationRule<AsyncApiServer> V2ServerRequiredFields =>
37-
new ValidationRule<AsyncApiServer>(
38-
(context, server) =>
39-
{
40-
context.Enter("url");
41-
if (server.Host == null)
42-
{
43-
context.CreateError(
44-
nameof(V2ServerRequiredFields),
45-
string.Format(Resource.Validation_FieldRequired, "url", "server"));
46-
}
47-
48-
context.Exit();
49-
50-
context.Enter("protocol");
51-
if (server.Protocol == null)
52-
{
53-
context.CreateError(
54-
nameof(V2ServerRequiredFields),
55-
string.Format(Resource.Validation_FieldRequired, "protocol", "server"));
56-
}
57-
5831
context.Exit();
5932
});
6033
}

0 commit comments

Comments
 (0)