You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In light of Flask's Reqparser not only behaving oddly and being less-than-well-documented, would there be interest in using Marshmallow instead of Reqparser? The change would be relatively simple - in checkin.py we'd have a schema for the GameListing model, and simply run schema.load(request.get_json()) to get back a valid model. For an example, here's a schema for the GameListing model:
from marshmallow import Schema, fields
class GameListingSchema(Schema):
game_name = fields.Str(required=True)
game_status = fields.Str(required=True)
game_website = fields.Str()
listing_contact = fields.Str(required=True)
short_description = fields.Str(validator=lambda v: return len(v) < 255)
long_description = fields.Str()
telnet_hostname = fields.Str()
telnet_port = fields.Integer()
web_client_url = fields.Str()
connected_account_count = fields.Integer()
total_account_count = fields.Integer()
evennia_version = fields.Str(required=True)
python_version = fields.Str()
django_version = fields.Str()
server_platform = fields.Str()
game_listing_schema = GameListingSchema()
...
# in GameListingCheckin(Resource)
result = game_listing_schema.load(request.get_json())
# process result as we did args
The text was updated successfully, but these errors were encountered:
In light of Flask's Reqparser not only behaving oddly and being less-than-well-documented, would there be interest in using Marshmallow instead of Reqparser? The change would be relatively simple - in
checkin.py
we'd have a schema for theGameListing
model, and simply runschema.load(request.get_json())
to get back a valid model. For an example, here's a schema for theGameListing
model:The text was updated successfully, but these errors were encountered: