reactiveui / refit

The automatic type-safe REST library for .NET Core, Xamarin and .NET. Heavily inspired by Square's Retrofit library, Refit turns your REST API into a live interface.
https://reactiveui.github.io/refit/
MIT License
8.53k stars 748 forks source link

[Bug]: Not throwing a ValidationApiException #1702

Open goforebroke opened 4 months ago

goforebroke commented 4 months ago

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

IsaacHayes1995 commented 3 months ago

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