Skip to content

Commit

Permalink
Remove webargs and FlaskParser for now (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Lane authored Jan 3, 2020
1 parent 7f18aed commit 4151106
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 43 deletions.
29 changes: 0 additions & 29 deletions confidant/schema/auto_build_schema.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from marshmallow import post_load, Schema
from webargs import core
from webargs.flaskparser import FlaskParser as FlaskParser_


class StrictSchema(Schema):
Expand Down Expand Up @@ -59,30 +57,3 @@ def build_object(self, data):
raise NotImplementedError('Subclass did not set "_class_to_load"')

return self._class_to_load(**data)


class FlaskParser(FlaskParser_):
"""
This subclass of the webargs FlaskParser[1] propagates the marshmallow
ValidationError so we can format it nicely.
[1] https://github.com/sloria/webargs/blob/dev/webargs/flaskparser.py
"""

def handle_error(self, error):
"""
:type error: marshmallow.ValidationError
"""
raise error

def parse_json(self, req, name, field):
"""Pull a json value from the request."""

json_data = req.get_json(force=True, silent=True)
if json_data:
return core.get_value(json_data, name, field)
else:
return core.missing


parser = FlaskParser()
11 changes: 0 additions & 11 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,6 @@ statsd==3.2.1
# Use: kmsauth support library
kmsauth==0.5.0

# License: MIT
# Schemas for handling complex datatypes
-e git+https://github.com/lyft/[email protected]#egg=marshmallow

# License: MIT
# A friendly library for parsing HTTP request arguments, with built-in support
# for popular web frameworks, including Flask, Django, Bottle, Tornado,
# Pyramid, webapp2, Falcon, and aiohttp. http://webargs.readthedocs.io/
# https://github.com/sloria/webargs
webargs==1.8.1

# License: Apache2
# Upstream url: https://pypi.python.org/pypi/toasted-marshmallow
# Use: input/output validation and json serialization
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ statsd==3.2.1
toastedmarshmallow==2.15.2.post1
typing==3.7.4.1 # via flake8
urllib3==1.25.3 # via botocore, requests
webargs==1.8.1
werkzeug==0.15.6 # via flask
xmlsec==1.3.3 # via python3-saml

Expand Down
2 changes: 0 additions & 2 deletions requirements3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#
# pip-compile --output-file=./requirements3.txt ./requirements.in
#
-e git+https://github.com/lyft/[email protected]#egg=marshmallow
asn1crypto==0.24.0 # via cryptography
attrs==19.3.0 # via toastedmarshmallow
authomatic==0.1.0.post1
Expand Down Expand Up @@ -59,6 +58,5 @@ six==1.12.0 # via cryptography, isodate, mock, pynamodb, pyopenssl
statsd==3.2.1
toastedmarshmallow==2.15.2.post1
urllib3==1.25.3 # via botocore, requests
webargs==1.8.1
werkzeug==0.15.6 # via flask
xmlsec==1.3.3 # via python3-saml

0 comments on commit 4151106

Please sign in to comment.