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
140
Merge Requests
140
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
5fe15e23
Commit
5fe15e23
authored
Apr 10, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! open_api: more request body support
parent
e9f0a931
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
bt5/erp5_open_api/DocumentTemplateItem/portal_components/document.erp5.OpenAPIService.py
...ateItem/portal_components/document.erp5.OpenAPIService.py
+2
-6
bt5/erp5_open_api/TestTemplateItem/portal_components/test.erp5.testOpenAPIService.py
...ateItem/portal_components/test.erp5.testOpenAPIService.py
+2
-0
No files found.
bt5/erp5_open_api/DocumentTemplateItem/portal_components/document.erp5.OpenAPIService.py
View file @
5fe15e23
...
@@ -25,15 +25,11 @@
...
@@ -25,15 +25,11 @@
#
#
##############################################################################
##############################################################################
import
base64
import
binascii
import
binascii
import
json
import
json
import
typing
import
typing
from
six.moves.urllib.parse
import
unquote
from
six.moves.urllib.parse
import
unquote
import
six
if
six
.
PY2
:
from
base64
import
decodestring
as
base64_decodebytes
else
:
from
base64
import
decodebytes
as
base64_decodebytes
if
typing
.
TYPE_CHECKING
:
if
typing
.
TYPE_CHECKING
:
from
typing
import
Any
,
Callable
,
Optional
from
typing
import
Any
,
Callable
,
Optional
...
@@ -313,7 +309,7 @@ class OpenAPIService(XMLObject):
...
@@ -313,7 +309,7 @@ class OpenAPIService(XMLObject):
if
schema
.
get
(
'type'
)
==
'string'
:
if
schema
.
get
(
'type'
)
==
'string'
:
if
schema
.
get
(
'format'
)
==
'base64'
:
if
schema
.
get
(
'format'
)
==
'base64'
:
try
:
try
:
return
base64
_decodebytes
(
parameter_value
)
return
base64
.
b64decode
(
parameter_value
)
except
binascii
.
Error
as
e
:
except
binascii
.
Error
as
e
:
raise
ParameterValidationError
(
raise
ParameterValidationError
(
'Error validating request body: {e}'
.
format
(
e
=
str
(
e
)))
'Error validating request body: {e}'
.
format
(
e
=
str
(
e
)))
...
...
bt5/erp5_open_api/TestTemplateItem/portal_components/test.erp5.testOpenAPIService.py
View file @
5fe15e23
...
@@ -26,10 +26,12 @@
...
@@ -26,10 +26,12 @@
##############################################################################
##############################################################################
import
six
import
six
# pylint:disable=no-name-in-module
if
six
.
PY2
:
if
six
.
PY2
:
from
base64
import
encodestring
as
base64_encodebytes
from
base64
import
encodestring
as
base64_encodebytes
else
:
else
:
from
base64
import
encodebytes
as
base64_encodebytes
from
base64
import
encodebytes
as
base64_encodebytes
# pylint:enable=no-name-in-module
import
io
import
io
import
json
import
json
import
unittest
import
unittest
...
...
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