File tree Expand file tree Collapse file tree
src/ByteBard.AsyncAPI/Validation/Rules Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 }
You can’t perform that action at this time.
0 commit comments