Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove webargs and FlaskParser for now #242

Merged
merged 1 commit into from
Jan 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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