Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValidateDataTypeMismatch is failing to parse examples #1879

Closed
darrelmiller opened this issue Oct 15, 2024 · 0 comments · Fixed by #1888
Closed

ValidateDataTypeMismatch is failing to parse examples #1879

darrelmiller opened this issue Oct 15, 2024 · 0 comments · Fixed by #1888
Assignees

Comments

@darrelmiller
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants