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

Why 400 can't display status code #128

Open
apchenjun opened this issue Mar 10, 2022 · 7 comments
Open

Why 400 can't display status code #128

apchenjun opened this issue Mar 10, 2022 · 7 comments

Comments

@apchenjun
Copy link

Why 400 can't display status code

{
    "isError": true,
    "error": {
        "message": "Request invalid.",
        "code": "BadRequest"
    }
}

I want to always show status code like 200

{
    "statusCode": 200,
    "message": "POST Request successful.",
    "result": {
        "totalCount": 0,
        "items": []
    }
}
@proudmonkey
Copy link
Owner

Have you set ShowStatusCode option?

@apchenjun
Copy link
Author

apchenjun commented Mar 11, 2022

@proudmonkey yes I have set that no status code is returned when the status code 400 is returned in the 200 status 。

    app.UseAutoWrapper(new AutoWrapperOptions
    {
        ShowStatusCode = true,
        IsDebug = !app.Environment.IsProduction(),
        ShowIsErrorFlagForSuccessfulResponse = true,
        DisableProblemDetailsException = true
    });

@proudmonkey
Copy link
Owner

Which version you are using for me to reproduce?

@apchenjun
Copy link
Author

@proudmonkey
image

@apchenjun
Copy link
Author

@proudmonkey Is it possible to reproduce and fix the problem

@proudmonkey
Copy link
Owner

@apchenjun My apologies for the late response. Just got so busy with so many things. :)

I will try to reproduce the issue using the latest version and provide a fix. I'll keep this thread posted. Thank you so much for your feedback. :)

@apchenjun
Copy link
Author

@proudmonkey I am using .Net Core 6.0

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

No branches or pull requests

2 participants