AutoWrapper icon indicating copy to clipboard operation
AutoWrapper copied to clipboard

Why 400 can't display status code

Open apchenjun opened this issue 3 years ago • 7 comments

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": []
    }
}

apchenjun avatar Mar 10 '22 01:03 apchenjun

Have you set ShowStatusCode option?

proudmonkey avatar Mar 10 '22 05:03 proudmonkey

@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
    });

apchenjun avatar Mar 11 '22 01:03 apchenjun

Which version you are using for me to reproduce?

proudmonkey avatar Mar 11 '22 03:03 proudmonkey

@proudmonkey image

apchenjun avatar Mar 11 '22 06:03 apchenjun

@proudmonkey Is it possible to reproduce and fix the problem

apchenjun avatar Mar 21 '22 06:03 apchenjun

@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. :)

proudmonkey avatar Apr 11 '22 18:04 proudmonkey

@proudmonkey I am using .Net Core 6.0

apchenjun avatar Apr 14 '22 09:04 apchenjun