{ "info": { "author": "Lily Seabreeze", "author_email": "lillian.gardenia.seabreeze@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "``flask_restful_jsonschema``\n============================\n\n|PyPI Version|\n\nAdd the ``@validate_json`` decorator and schema class constant to\n``flask_restful.Resource`` methods (post, get, etc.) in order to\nvalidate requests meet the ``jsonschema``.\n\nEnsure JSON request matches schema specified in the class the wrapped\nmethod belongs to, provide that valid JSON to the method, or abort 400\nwith the validation error message.\n\n.. code:: python\n\n from flask_restful_jsonschema import validate_json\n\n\n class Users(flask_restful.Resource):\n SCHEMA_POST = {\n \"type\": \"object\",\n \"properties\": {\n \"email\": {\"type\": \"string\"},\n \"password\": {\"type\": \"string\"},\n },\n \"required\": [\"email\", \"password\"],\n }\n SCHEMA_PUT = {\n \"type\": \"object\",\n \"properties\": {\n \"email\": {\"type\": \"string\"},\n \"password\": {\"type\": \"string\"},\n },\n }\n SCHEMA_GET = {\n \"type\": \"object\",\n \"properties\": {\n \"email\": {\"type\": \"string\"},\n },\n \"required\": [\"email\"],\n }\n\n @validate_json\n def post(self, json_request):\n json_request[\"email\"]\n json_request[\"password\"]\n\n @validate_json\n def put(self, json_request):\n json_request.get(\"email\")\n json_request.get(\"password\")\n\n @validate_json\n def get(self, json_request):\n json_request[\"email\"]\n\n.. |PyPI Version| image:: https://img.shields.io/pypi/v/flask_restful_jsonschema.svg?style=flat-square\n :target: https://pypi.python.org/pypi/flask_restful_jsonschema/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "flask_restful_jsonschema", "package_url": "https://pypi.org/project/flask_restful_jsonschema/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/flask_restful_jsonschema/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/flask_restful_jsonschema/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Provides a wrapper which provides valid json to Resource methods.", "version": "0.1.1" }, "last_serial": 2371422, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "08f2c30a0eb1b718d2980735477c247b", "sha256": "28aaa82f09bc0cd1300c9c369b4bc1a83340710b321166f237ef0a3d6fa4c09d" }, "downloads": -1, "filename": "flask_restful_jsonschema-0.1.0.tar.gz", "has_sig": false, "md5_digest": "08f2c30a0eb1b718d2980735477c247b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1739, "upload_time": "2016-09-29T07:29:47", "url": "https://files.pythonhosted.org/packages/07/ef/f098709dbb7ad57fee9200391fddec775f942dfe35fd6efcd293fa270156/flask_restful_jsonschema-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e1ce358834c80da6ccd2636ec65d0c17", "sha256": "4c81fd18d18f70d77671c540411e0077f5ef1bc050306ac361e05b5b61b613ac" }, "downloads": -1, "filename": "flask_restful_jsonschema-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e1ce358834c80da6ccd2636ec65d0c17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1929, "upload_time": "2016-09-29T16:07:13", "url": "https://files.pythonhosted.org/packages/37/4d/7272160f8bf3ad47eb22328ddaeccf775d9a466deb0d685e16a73029f0b3/flask_restful_jsonschema-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e1ce358834c80da6ccd2636ec65d0c17", "sha256": "4c81fd18d18f70d77671c540411e0077f5ef1bc050306ac361e05b5b61b613ac" }, "downloads": -1, "filename": "flask_restful_jsonschema-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e1ce358834c80da6ccd2636ec65d0c17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1929, "upload_time": "2016-09-29T16:07:13", "url": "https://files.pythonhosted.org/packages/37/4d/7272160f8bf3ad47eb22328ddaeccf775d9a466deb0d685e16a73029f0b3/flask_restful_jsonschema-0.1.1.tar.gz" } ] }