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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
0223cfd6
Commit
0223cfd6
authored
May 04, 2022
by
Cédric Le Ninivin
Committed by
Cédric Le Ninivin
Mar 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_api_style: Add Schema to error response
parent
eb7e2ccf
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 @
0223cfd6
...
@@ -11,6 +11,7 @@ container.REQUEST.RESPONSE.setStatus(400)
...
@@ -11,6 +11,7 @@ container.REQUEST.RESPONSE.setStatus(400)
# We follow here Paypal api guideline
# We follow here Paypal api guideline
# https://github.com/paypal/api-standards/blob/master/api-style-guide.md#error-schema
# https://github.com/paypal/api-standards/blob/master/api-style-guide.md#error-schema
error_dict
=
{
error_dict
=
{
"$schema"
:
"error-response-schema.json"
,
"debug_id"
:
error
.
getId
(),
"debug_id"
:
error
.
getId
(),
"status"
:
error_code
,
"status"
:
error_code
,
"message"
:
error_message
"message"
:
error_message
...
...
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_style/error-response-schema.json.json
0 → 100644
View file @
0223cfd6
{
"$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 @
0223cfd6
<?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