Commit eae7eded authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Titouan Soulard

erp5_api_style: Add Schema to error response

parent 91a208ee
......@@ -11,6 +11,7 @@ container.REQUEST.RESPONSE.setStatus(400)
# We follow here Paypal api guideline
# https://github.com/paypal/api-standards/blob/master/api-style-guide.md#error-schema
error_dict = {
"$schema": "error-response-schema.json",
"debug_id": error.getId(),
"status": error_code,
"message": error_message
......
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "error-response-schema.json",
"title": "Error Response",
"properties": {
"debug_id": {
"title": "Debug Id",
"type": "string",
"description": "Unique Id of the error"
},
"name": {
"title": "Error Name",
"type": "string"
},
"message": {
"title": "Error Message",
"type": "string"
},
"link": {
"title": "Explanation Link",
"type": "string"
},
"details": {
"title": "Details",
"type": "object"
},
"status": {
"title": "Status Code",
"type": "string"
}
}
}
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>error-response-schema.json</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/json</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>error-response-schema.json</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment