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

An argument out of range exception is thrown when invalid JSON is passed to a FE endpoint. #391

Closed
hoxhaerin opened this issue Feb 28, 2023 · 1 comment
Labels
bug Something isn't working fixed the bug has been squashed

Comments

@hoxhaerin
Copy link

hoxhaerin commented Feb 28, 2023

This line here:

ValidationFailures.Add(new(x.Path?[2..] ?? "Unknown", x.InnerException?.Message ?? "Unknown de-serialization error!"));

more specifically this part: [2..], throws an ArgumentOutOfRangeException | startIndex cannot be larger than length of string. (Parameter 'startIndex') when you add an extra comma at the end of the JSON request.

{
  "code": "A001",
  "name": "",
  "marketingName": "fsa",
}

I'd open a PR myself but I don't know why you have added that index there and how you'll want to handle it, so I'm just leaving this here.

image

@dj-nitehawk
Copy link
Member

fixed in v5.7.2.8-beta
thanks for reporting!

@dj-nitehawk dj-nitehawk added bug Something isn't working fixed the bug has been squashed labels Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed the bug has been squashed
Development

No branches or pull requests

2 participants