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

[Bug]: Not throwing a ValidationApiException #1702

Open
goforebroke opened this issue May 21, 2024 · 1 comment
Open

[Bug]: Not throwing a ValidationApiException #1702

goforebroke opened this issue May 21, 2024 · 1 comment
Labels

Comments

@goforebroke
Copy link

goforebroke commented May 21, 2024

Describe the bug 🐞

A bug happened!

I have an API that returns a problem details when supplied inputs fail validation

refit 1 refit 2

I have a razor page application using the refit library to make api calls.

refit 5

When the application posts data with invalid inputs an ApiException is caught, but not a ValidationApiException. If the ApiException has a content type "application/problem+json", a ValidationApiException should be thrown?

refit 4 refit 3

Step to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Reproduction repository

https://github.com/reactiveui/refit

Expected behavior

This should happen...

A ValidationException should be thrown with a content type application/problem+json

Screenshots 🖼️

No response

IDE

Visual Studio 2022

Operating system

Windows

Version

11

Device

No response

Refit Version

Refit.HttpClientFactory 7.0.0

Additional information ℹ️

No response

@goforebroke goforebroke changed the title [Bug]: Not able to throw Validation Exception [Bug]: Not able to throw ValidationApiException May 22, 2024
@goforebroke goforebroke changed the title [Bug]: Not able to throw ValidationApiException [Bug]: Not throwing a ValidationApiException May 22, 2024
@IsaacHayes1995
Copy link

Bumping this, as I've just hit the same issue.

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

No branches or pull requests

2 participants