我在项目中配置了以下验证介体:
<validate>
<schema key="gov:custom/testReg/AddressId.json"/>
<resource key="gov:custom/testReg/AddressId.json" location="default_location"/>
<on-fail>
<payloadFactory description="failureResponse" media-type="json">
<format>{
"StatusCode": 0,
"ErrorCode": "801001",
"ErrorDescription": "Invalid request parameters, some fields are empty"
}
</format>
<args/>
</payloadFactory>
<respond description="failureResponse"/>
</on-fail>
</validate>
但是,当我保存API资源时,它会引发以下错误:
A non-empty <on-fail> child element is required for the <validate> mediator
我试图忽略这些错误,并继续构建项目并部署它,但是在部署服务器后,服务器中存在错误。 有人可以帮我这个忙吗?
谢谢。