-
Notifications
You must be signed in to change notification settings - Fork 40
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
The same IdempotencyKey cannot return a custom error message #24
Comments
Hi @apchenjun This error happened with me too In my case, i am using swagger to generate openapi documentation It occurs by a validation of swagger filter.. In your method or controller class you must add a (ProducessAtributte("application/json")) Hope that it can help you |
Hello @apchenjun, As @william-keller mentioned, the Can you try to define it at your controller? For example, see the following sample code: [ApiController]
[Route("[controller]")]
[Consumes("application/json")]
[Produces("application/json")]
[Idempotent(Enabled = true)]
public class SimpleController : ControllerBase
{
// ...
} In general, the concept of the library and Idempotency as described in the README file is to return the cached response (generated on the first try) in the subsequent requests (i.e., second, third, etc.) when using the same IdempotencyKey. That means that the actual code of the controller (action) will not be executed multiple times. |
The first request can normally receive the returned custom format message
The second request cannot receive the custom format message
The second request with postman return 500
The first
The second
The text was updated successfully, but these errors were encountered: