none
Filtering the .net core 2.2 API model state error RRS feed

  • Question

  • Hello I have an angular application and I want to catch only the model state errors of my .net core 2.2 webapi backend.

    The errors that I'm catching are the following

    {
        "errors": {
            "Password": [
                "The Password field is required.",
                "You must specify password between 4 to 8 characters"
            ],
            "Username": [
                "The Username field is required."
            ]
        },
        "title": "One or more validation errors occurred.",
        "status": 400,
        "traceId": "0HLLRTRDHO946:0000000A"
    }

    I only wanted to catch the error like this

    {

    "Password": [
                "The Password field is required.",
                "You must specify password between 4 to 8 characters"
            ],
            "Username": [
                "The Username field is required."
            ]

    }

    Monday, April 8, 2019 6:59 AM

Answers