File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
test/Microsoft.OpenApi.Tests Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1154,7 +1154,6 @@ namespace Microsoft.OpenApi.Validations.Rules
1154
1154
{
1155
1155
public static Microsoft.OpenApi.Validations.ValidationRule<Microsoft.OpenApi.Models.OpenApiLicense> LicenseRequiredFields { get; }
1156
1156
}
1157
- [Microsoft.OpenApi.Validations.Rules.OpenApiRule]
1158
1157
public static class OpenApiMediaTypeRules
1159
1158
{
1160
1159
public static Microsoft.OpenApi.Validations.ValidationRule<Microsoft.OpenApi.Models.OpenApiMediaType> MediaTypeMismatchedDataType { get; }
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ public void ValidateExampleShouldNotHaveDataTypeMismatchForSimpleSchema()
32
32
} ;
33
33
34
34
// Act
35
- var validator = new OpenApiValidator ( ValidationRuleSet . GetDefaultRuleSet ( ) ) ;
35
+ var ruleset = ValidationRuleSet . GetDefaultRuleSet ( ) ;
36
+ ruleset . Add ( OpenApiMediaTypeRules . MediaTypeMismatchedDataType ) ;
37
+ var validator = new OpenApiValidator ( ruleset ) ;
36
38
var walker = new OpenApiWalker ( validator ) ;
37
39
walker . Walk ( mediaType ) ;
38
40
@@ -102,7 +104,9 @@ public void ValidateExamplesShouldNotHaveDataTypeMismatchForSimpleSchema()
102
104
} ;
103
105
104
106
// Act
105
- var validator = new OpenApiValidator ( ValidationRuleSet . GetDefaultRuleSet ( ) ) ;
107
+ var ruleset = ValidationRuleSet . GetDefaultRuleSet ( ) ;
108
+ ruleset . Add ( OpenApiMediaTypeRules . MediaTypeMismatchedDataType ) ;
109
+ var validator = new OpenApiValidator ( ruleset ) ;
106
110
var walker = new OpenApiWalker ( validator ) ;
107
111
walker . Walk ( mediaType ) ;
108
112
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public void DefaultRuleSetPropertyReturnsTheCorrectRules()
43
43
Assert . NotEmpty ( rules ) ;
44
44
45
45
// Update the number if you add new default rule(s).
46
- Assert . Equal ( 21 , rules . Count ) ;
46
+ Assert . Equal ( 20 , rules . Count ) ;
47
47
}
48
48
}
49
49
}
You can’t perform that action at this time.
0 commit comments