Stack Exchange
Swagger validation for request parameter and custom error message
I need a help regarding swagger validation with spring boot.
In Req1  it is not showing the field name, could you help with this? Also how to give custom error message for any validations?
Update:
In the response of the req1 is not showing field name(productCode) in message but in response of req2 we could see the field name.
type: object
    description: get details request object
    required: [productCode]
    properties:
      productCode:
        type: string
        minLength: 1
        description: Identifier for application 

--Req1-----
{
"productCode":""
}

--Res1-----
{
   "code": "400",
   "status": 400,
   "message": "Validation Failed: string \"\" is too short (length: 0, required minimum: 1)"
}

--Req2-----
{  }

--Res2-----
{
   "code": "400",
   "status": 400,
   "message": "Validation Failed: object has missing required properties ([\"productCode\"])"
} 


"it is not showing the field name" - not showing it where exactly? In the debugger, in the API docs, somewhere else?

Thanks for reply.I updated the question pls check.

@sunleo Did you find any solution for this?
