Skip to content

Commit 05a1d77

Browse files
committed
Removed DataTypeMismatch as default rule
1 parent d4a0b8e commit 05a1d77

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Microsoft.OpenApi/Validations/Rules/OpenApiMediaTypeRules.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ namespace Microsoft.OpenApi.Validations.Rules
88
/// <summary>
99
/// The validation rules for <see cref="OpenApiMediaType"/>.
1010
/// </summary>
11-
[OpenApiRule]
11+
/// <remarks>
12+
/// Removed this in v1.3 as a default rule as the OpenAPI specification does not require that example
13+
/// values validate against the schema. Validating examples against the schema is particularly difficult
14+
/// as it requires parsing of the example using the schema as a guide. This is not possible when the schema
15+
/// is ref'd. Even if we fix this issue, this rule should be treated as a warning, not an error
16+
/// Future versions of the validator should make that distinction.
17+
/// Future versions of the example parsers should not try an infer types.
18+
/// Example validation should be done as a separate post reading step so all schemas can be fully available.
19+
/// </remarks>
20+
//[OpenApiRule]
1221
public static class OpenApiMediaTypeRules
1322
{
1423
/// <summary>

0 commit comments

Comments
 (0)