Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
b4a8307d
Commit
b4a8307d
authored
May 04, 2022
by
Cédric Le Ninivin
Committed by
Titouan Soulard
Nov 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_api_style: Add Schema to error response
parent
d4a3f05f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
0 deletions
+61
-0
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_style/ERP5Site_logApiErrorAndReturn.py
...tal_skins/erp5_api_style/ERP5Site_logApiErrorAndReturn.py
+1
-0
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_style/error-response-schema.json.json
...rtal_skins/erp5_api_style/error-response-schema.json.json
+32
-0
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_style/error-response-schema.json.xml
...ortal_skins/erp5_api_style/error-response-schema.json.xml
+28
-0
No files found.
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_style/ERP5Site_logApiErrorAndReturn.py
View file @
b4a8307d
...
...
@@ -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
...
...
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_style/error-response-schema.json.json
0 → 100644
View file @
b4a8307d
{
"$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
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_style/error-response-schema.json.xml
0 → 100644
View file @
b4a8307d
<?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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment