{ "info": { "author": "Robert Cope, Charles Blaxland", "author_email": "robert@copesystems.com, charles.blaxland@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Plugins", "Environment :: Web Environment", "Framework :: Bottle", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=====================\nBottle Swagger Plugin\n=====================\n\n.. image:: https://travis-ci.org/cope-systems/bottle-swagger.svg?branch=master\n :target: https://travis-ci.org/cope-systems/bottle-swagger\n\nAbout\n-----\nThis project is a Bottle plugin for working with Swagger.\n`Bottle `_ is a Python web framework.\n`Swagger (OpenAPI) `_ is a standard for defining REST APIs.\n\nThis plugin is derived from Charles Blaxland's bottle-swagger plugin:\nhttps://github.com/ampedandwired/bottle-swagger\n\nSo if you are serving a REST API with Bottle,\nand you have a defined a Swagger schema for that API,\nthis plugin can:\n\n* Validate incoming requests and outgoing responses against the swagger schema\n* Return appropriate error responses on validation failures\n* Serve your swagger schema via Bottle (for use in `Swagger UI `_ for example)\n\nRequirements\n------------\n\n* Python >= 2.7\n* Bottle >= 0.12\n* Swagger specification == 2.0\n\nThis project relies on `bravado-core `_ to perform the swagger schema validation,\nso any version of the Swagger spec supported by that project is also supported by this plugin. Note that Bravado Core\ndoes not yet support the OpenAPI 3.0 specification, thus this plugin does not work with OpenAPI 3.0 yet.\n\nInstallation\n------------\n::\n\n $ pip install bottle-swagger-2\n\nUsage\n-----\nSee the \"example\" directory for a working example of using this plugin.\n\nThe simplest usage is::\n\n import bottle\n\n swagger_def = _load_swagger_def()\n bottle.install(SwaggerPlugin(swagger_def))\n\nWhere \"_load_swagger_def\" returns a dict representing your swagger specification\n(loaded from a yaml file, for example).\n\nThere are a number of arguments that you can pass to the plugin constructor:\n\n* ``validate_swagger_spec`` - Boolean (default ``True``) indicating if the plugin should actually validate the Swagger spec.\n\n* ``validate_requests`` - Boolean (default ``True``) indicating if incoming requests should be validated or not.\n\n* ``validate_responses`` - Boolean (default ``True``) indicating if outgoing responses should be validated or not.\n\n* ``use_bravado_models`` - Boolean (default ``True``) Should the Swagger data attached to the request be a Bravado model or just a dictionary?\n\n* ``user_defined_formats`` - List (default ``None``) Any user defined Swagger formats that may be fed into Bravado core.\n\n* ``include_missing_properties`` - Boolean (default ``True``) Should missing properties off of object in Swagger be included with ``None`` values?\n\n* ``default_type_to_object`` - Boolean (default ``False``) Should Swagger attributes or schemas missing the type parameter be forced to be ``object`` by default (if true) or can they be anything (if false).\n\n* ``internally_derefence_refs`` - Boolean (default ``False``) Should Bravado Core dereference all $refs for a performance speedup?\n\n* ``ignore_undefined_api_routes`` - Boolean (default ``False``) Should any routes under the given base path that don't have a Swagger route automatically trigger a 404?\n\n* ``auto_jsonify`` - Boolean (default ``False``) If the Swagger route handlers return a list or dict, should we attempt to automatically convert them to a JSON response?\n\n* ``invalid_request_handler`` - Callback called when request validation has failed. Default behaviour is to return a \"400 Bad Request\" response.\n\n* ``invalid_response_handler`` - Callback called when response validation has failed. Default behaviour is to return a \"500 Server Error\" response.\n\n* ``swagger_op_not_found_handler`` - Callback called when no swagger operation matching the request was found in the swagger schema. Default behaviour is to return a \"404 Not Found\" response.\n\n* ``exception_handler=_server_error_handler`` - Callback called when an exception is thrown by downstream handlers (including exceptions thrown by your code). Default behaviour is to return a \"500 Server Error\" response.\n\n* ``swagger_base_path`` - String (default ``None``) Used to set and override the ``basePath`` mechanic for telling bottle what subpath to serve the API from.\n\n* ``adjust_api_base_path`` - Boolean (default ``True``) Adjust the basePath reported by the swagger.json. This is important if your WSGI application is running under a subpath.\n\n* ``serve_swagger_schema`` - Boolean (default ``True``) indicating if the Swagger schema JSON should be served\n\n* ``swagger_schema_suburl`` - URL (default ``\"/swagger.json\"``) on which to serve the Swagger schema JSON from the API subpath\n\n* ``serve_swagger_ui`` - Boolean (default ``False``) Should we use a built-in copy of Swagger UI to serve up docs for this API?\n\n* ``swagger_ui_schema_url`` - String or Arity 0 callable returning a string (default ``None``) If this is not none and the Swagger UI is turned on, this will be used to set the Swagger schema URL from which the UI draws the schema by default. If this is an arity 0 callable (i.e. a function with no arguments), this will be evaluated every time the UI is generated, which may allow the developer to dynamically select the schema URL.\n\n* ``swagger_ui_suburl`` - String (default ``\"/ui/\"``) The API suburl to serve the built-in Swagger UI up at, if turned on.\n\n* ``swagger_ui_validator_url`` -- String (default ``None``) The URL for a Swagger spec validator. By default this is None (i.e. off). This may also be an arity 0 callable that will dynamically select the validator URL when the UI is generated.\n\n* ``extra_bravado_config`` - Dict (default ``None``) Any additional configuration items to pass to Bravado core.\n\nAll the callbacks above receive a single parameter representing the ``Exception`` that was raised,\nor in the case of ``swagger_op_not_found_handler`` the ``Route`` that was not found.\nThey should all return a Bottle ``Response`` object.\n\nContributing\n------------\nDevelopment happens in the `bottle-swagger GitHub respository `_.\nPull requests (with accompanying unit tests), feature suggestions and bug reports are welcome.\n\nUse \"tox\" to run the unit tests::\n\n $ tox", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/cope-systems/bottle-swaggerr/archive/v2.0.7.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cope-systems/bottle-swagger", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "bottle-swagger-2", "package_url": "https://pypi.org/project/bottle-swagger-2/", "platform": "any", "project_url": "https://pypi.org/project/bottle-swagger-2/", "project_urls": { "Download": "https://github.com/cope-systems/bottle-swaggerr/archive/v2.0.7.tar.gz", "Homepage": "https://github.com/cope-systems/bottle-swagger" }, "release_url": "https://pypi.org/project/bottle-swagger-2/2.0.7/", "requires_dist": null, "requires_python": "", "summary": "Swagger Integration for Bottle", "version": "2.0.7" }, "last_serial": 5657330, "releases": { "2.0.1": [ { "comment_text": "", "digests": { "md5": "1090e4532fc9a796d736ec3360d6ec44", "sha256": "256b80af26845d419e125c8150fe06d0361dde22e299484af48a3b74480af0c3" }, "downloads": -1, "filename": "bottle_swagger_2-2.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1090e4532fc9a796d736ec3360d6ec44", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 566105, "upload_time": "2019-05-23T04:42:55", "url": "https://files.pythonhosted.org/packages/cc/c2/bc08359d036d3a8545d67902d50c1e2f8393a67186b32608412634cee637/bottle_swagger_2-2.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "28b9510c2d4b6e10db05b712901a9866", "sha256": "82cc0c47340f00183368024305ccb8f375ce0eb26399e90e630e70117b8d48fd" }, "downloads": -1, "filename": "bottle-swagger-2-2.0.1.tar.gz", "has_sig": false, "md5_digest": "28b9510c2d4b6e10db05b712901a9866", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 564721, "upload_time": "2019-05-23T04:42:58", "url": "https://files.pythonhosted.org/packages/34/78/0fed1180b7845f6aba31c4658c674b33e833ab59a350ba0bf01d92671fdb/bottle-swagger-2-2.0.1.tar.gz" } ], "2.0.3": [ { "comment_text": "", "digests": { "md5": "04027ad3d90bd65225e490ac10a1e167", "sha256": "2ff36f3dbfe62657f497523728ba96c5589d55f07c5f5754014420a680e34cbb" }, "downloads": -1, "filename": "bottle-swagger-2-2.0.3.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "04027ad3d90bd65225e490ac10a1e167", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 566570, "upload_time": "2019-05-24T07:23:06", "url": "https://files.pythonhosted.org/packages/fd/57/8b08e56f12665ebab535229d9bad41f33d0de832ea72a76f806d9d8f5a7f/bottle-swagger-2-2.0.3.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "fb96bb3c54f4d3c24033f356ee3800a8", "sha256": "4dea6cfc29dfa29ac0bc6be03ba56183668e5b63a015d4d4ac3ab342923c53e9" }, "downloads": -1, "filename": "bottle_swagger_2-2.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "fb96bb3c54f4d3c24033f356ee3800a8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 568248, "upload_time": "2019-05-24T07:23:04", "url": "https://files.pythonhosted.org/packages/fa/57/cfef4804f97d7d9cb480ac87ccb531b57668022acad5bf0f9b7bae57d205/bottle_swagger_2-2.0.3-py3-none-any.whl" } ], "2.0.4": [ { "comment_text": "", "digests": { "md5": "00faf13c2e0b05c94a4565b52c807753", "sha256": "40eb637cb54864914001adb35676d9ec9bbe905c827b585382fd36dcfff94a43" }, "downloads": -1, "filename": "bottle_swagger_2-2.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "00faf13c2e0b05c94a4565b52c807753", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 568308, "upload_time": "2019-05-24T23:54:43", "url": "https://files.pythonhosted.org/packages/40/84/05a10d26b5df200f0f458d27b3c5a66d51cc2fb2b7e450d51624a5d47f43/bottle_swagger_2-2.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e0d5a22d19809ffe8bf7d039e1e9fe77", "sha256": "678bb07d3832b2e6abe375b158c5125eacbf202a8968c6987a91e2a7fb3df51d" }, "downloads": -1, "filename": "bottle-swagger-2-2.0.4.tar.gz", "has_sig": false, "md5_digest": "e0d5a22d19809ffe8bf7d039e1e9fe77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 565691, "upload_time": "2019-05-24T23:54:45", "url": "https://files.pythonhosted.org/packages/0b/24/6e4e7bb655aa8d0f0a9e707981c9ffcc0504523991cc9bae04769b88ed31/bottle-swagger-2-2.0.4.tar.gz" } ], "2.0.5": [ { "comment_text": "", "digests": { "md5": "5eb34aaf095da9da860f4e014f265cf2", "sha256": "8edbb713e8596dc8991bd5ae35486079f66555a1dee454f0d6133ed03cb41ff2" }, "downloads": -1, "filename": "bottle_swagger_2-2.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "5eb34aaf095da9da860f4e014f265cf2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 568464, "upload_time": "2019-05-27T04:38:46", "url": "https://files.pythonhosted.org/packages/e2/f5/b77c672a5407a9e08eebdbe1e4708edba200a8c10326bed5ab45bd43c708/bottle_swagger_2-2.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c5d0cdc82e5d197c10ac416b41700fbc", "sha256": "c88b04b88f55ef78e0444bc9f3414398c99a37caf7aacef79c48a9b9bb1d947e" }, "downloads": -1, "filename": "bottle-swagger-2-2.0.5.tar.gz", "has_sig": false, "md5_digest": "c5d0cdc82e5d197c10ac416b41700fbc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 566143, "upload_time": "2019-05-27T04:38:48", "url": "https://files.pythonhosted.org/packages/84/d7/4e73ab825060a8e133e0f479c194f83393e139334119a15494664826694b/bottle-swagger-2-2.0.5.tar.gz" } ], "2.0.6": [ { "comment_text": "", "digests": { "md5": "0f7194d5544361cbb0e1653e0b4d35bf", "sha256": "05105a95c400b81b29f153cee924cf9cfaeeefb9f616cc51f26d2f041b7f58bd" }, "downloads": -1, "filename": "bottle-swagger-2-2.0.6.tar.gz", "has_sig": false, "md5_digest": "0f7194d5544361cbb0e1653e0b4d35bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 566204, "upload_time": "2019-08-07T22:09:22", "url": "https://files.pythonhosted.org/packages/5b/a3/27b1041efcf648ded4a676bcfa846764fa932383441bd0bfa8b9a6f0b6b1/bottle-swagger-2-2.0.6.tar.gz" } ], "2.0.7": [ { "comment_text": "", "digests": { "md5": "efd66320e990b62eb225db286da0a86e", "sha256": "70d6ff19bcb26885f9abed6aa05494c479124c5af4909b149b306fdb490bc62b" }, "downloads": -1, "filename": "bottle_swagger_2-2.0.7-py3.6.egg", "has_sig": false, "md5_digest": "efd66320e990b62eb225db286da0a86e", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 574367, "upload_time": "2019-08-09T18:46:37", "url": "https://files.pythonhosted.org/packages/b7/a2/eed14b0eafdcd1d13947e2c30d3ae068e764ab49ef618f6e6d699a8cce08/bottle_swagger_2-2.0.7-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "dfc3349f609dcee6d7cf82ba2bec6448", "sha256": "65478999d1c300f33f2cc76d426f50873bb1810699a970c30a03c9c7e6e34e2e" }, "downloads": -1, "filename": "bottle-swagger-2-2.0.7.tar.gz", "has_sig": false, "md5_digest": "dfc3349f609dcee6d7cf82ba2bec6448", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 568891, "upload_time": "2019-08-09T18:46:39", "url": "https://files.pythonhosted.org/packages/0a/a7/d1c0c779df960071d19c83b820afb0dea7b4606fad56564ea861796ccdb8/bottle-swagger-2-2.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "efd66320e990b62eb225db286da0a86e", "sha256": "70d6ff19bcb26885f9abed6aa05494c479124c5af4909b149b306fdb490bc62b" }, "downloads": -1, "filename": "bottle_swagger_2-2.0.7-py3.6.egg", "has_sig": false, "md5_digest": "efd66320e990b62eb225db286da0a86e", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 574367, "upload_time": "2019-08-09T18:46:37", "url": "https://files.pythonhosted.org/packages/b7/a2/eed14b0eafdcd1d13947e2c30d3ae068e764ab49ef618f6e6d699a8cce08/bottle_swagger_2-2.0.7-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "dfc3349f609dcee6d7cf82ba2bec6448", "sha256": "65478999d1c300f33f2cc76d426f50873bb1810699a970c30a03c9c7e6e34e2e" }, "downloads": -1, "filename": "bottle-swagger-2-2.0.7.tar.gz", "has_sig": false, "md5_digest": "dfc3349f609dcee6d7cf82ba2bec6448", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 568891, "upload_time": "2019-08-09T18:46:39", "url": "https://files.pythonhosted.org/packages/0a/a7/d1c0c779df960071d19c83b820afb0dea7b4606fad56564ea861796ccdb8/bottle-swagger-2-2.0.7.tar.gz" } ] }