Skip to content
Permalink
Browse files

💣 use json, don't require Header Type

  • Loading branch information...
yelizariev committed Aug 10, 2019
1 parent d678775 commit 82bc95e93858fd30ab978ba2f31fe0b73ead287f
Showing with 4 additions and 3 deletions.
  1. +0 −1 openapi/controllers/__init__.py
  2. +3 −2 openapi/controllers/apijsonrequest.py
  3. +1 −0 openapi/models/openapi_access.py
@@ -3,4 +3,3 @@
from . import main
from . import api
from . import pinguin
from . import apijsonrequest
@@ -73,7 +73,7 @@ def handler():
_logger.info('%s: %s', self.httprequest.path, msg)
raise werkzeug.exceptions.BadRequest(msg)

self.params = dict(self.ApiJsonRequest.get("params", {}))
self.params = dict(self.ApiJsonRequest or {})
self.context = self.params.pop('context', dict(self.session.context))

def _json_response(self, result=None, error=None):
@@ -222,7 +222,8 @@ def response_wrap(*args, **kw):
def api_get_request(self, httprequest):
# deduce type of request

if httprequest.headers.get('Type') and httprequest.headers.get('Type') in ('api'):
if 'authorization' in httprequest.headers:
# if httprequest.headers.get('Type') and httprequest.headers.get('Type') in ('api'):
return ApiJsonRequest(httprequest)

return get_request_original(self, httprequest)
@@ -167,6 +167,7 @@ def get_OAS_paths_part(self):
"summary": "Add a new %s object to the store" % model_name,
"description": "",
"operationId": "add%s" % capitalized_model_name,
"consumes": ["application/json"],
"parameters": [
{
"in": "body",

0 comments on commit 82bc95e

Please sign in to comment.
You can’t perform that action at this time.