Skip to content

ValidateDataTypeMismatch is failing to parse examplesΒ #1879

@darrelmiller

Description

@darrelmiller

Describe the bug

dotnet run -- validate -d https://raw.githubusercontent.com/documentaciononyxsoft/documentacion/refs/heads/master/ApiIntervention.yaml
crit: Microsoft.OpenApi.Hidi.Handlers.ValidateCommandHandler[0]
Command failed
Unhandled exception: System.InvalidOperationException: Could not validate the document, reason: Unable to cast object of type 'System.String[]' to type 'System.String'.
---> System.InvalidCastException: Unable to cast object of type 'System.String[]' to type 'System.String'.
at Microsoft.OpenApi.Validations.Rules.RuleHelpers.ValidateDataTypeMismatch(IValidationContext context, String ruleName, JsonNode value, OpenApiSchema schema) in D:\github\microsoft\openapi.net\src\Microsoft.OpenApi\Validations\Rules\RuleHelpers.cs:line 58

OpenApi File To Reproduce
https://raw.githubusercontent.com/documentaciononyxsoft/documentacion/refs/heads/master/ApiIntervention.yaml

Expected behavior
I don't expect ValidateDataTypeMismatch. I was expecting that we had removed this rule from the default set of rules.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions