{ "info": { "author": "Charles Blaxland", "author_email": "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", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=====================\nBottle Swagger Plugin\n=====================\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\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.\n\nInstallation\n------------\n::\n\n $ pip install bottle-swagger\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_requests`` - Boolean (default ``True``) indicating if incoming requests should be validated or not\n* ``validate_responses`` - Boolean (default ``True``) indicating if outgoing responses should be validated or not\n* ``ignore_undefined_routes`` - Boolean (default ``False``) indicating if undefined routes\n (that is, routes not defined in the swagger spec) should be passed on (\"True\") or return a 404 (\"False\")\n* ``invalid_request_handler`` - Callback called when request validation has failed.\n Default behaviour is to return a \"400 Bad Request\" response.\n* ``invalid_response_handler`` - Callback called when response validation has failed.\n Default behaviour is to return a \"500 Server Error\" response.\n* ``swagger_op_not_found_handler`` - Callback called when no swagger operation matching the request was found in the swagger schema.\n Default behaviour is to return a \"404 Not Found\" response.\n* ``exception_handler=_server_error_handler`` - Callback called when an exception is thrown by downstream handlers (including exceptions thrown by your code).\n Default behaviour is to return a \"500 Server Error\" response.\n* ``serve_swagger_schema`` - Boolean (default ``True``) indicating if the Swagger schema JSON should be served\n* ``swagger_schema_url`` - URL (default ``/swagger.json``) on which to serve the Swagger schema JSON\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\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/ampedandwired/bottle-swagger/archive/v1.2.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ampedandwired/bottle-swagger", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "bottle-swagger", "package_url": "https://pypi.org/project/bottle-swagger/", "platform": "any", "project_url": "https://pypi.org/project/bottle-swagger/", "project_urls": { "Download": "https://github.com/ampedandwired/bottle-swagger/archive/v1.2.0.tar.gz", "Homepage": "https://github.com/ampedandwired/bottle-swagger" }, "release_url": "https://pypi.org/project/bottle-swagger/1.2.0/", "requires_dist": null, "requires_python": null, "summary": "Swagger integration for Bottle", "version": "1.2.0" }, "last_serial": 2294695, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "ae0a4c0636914029ea5ea2e14c61676e", "sha256": "57347089a9779d05105554671d63326066b54072cec0fcf9150b4242abe149d5" }, "downloads": -1, "filename": "bottle-swagger-1.0.1.tar.gz", "has_sig": false, "md5_digest": "ae0a4c0636914029ea5ea2e14c61676e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4544, "upload_time": "2016-05-26T04:01:24", "url": "https://files.pythonhosted.org/packages/74/2f/ee07b78eb2c8d193b467a375c9eaa715d6f17d077d8c6579214a911c07f0/bottle-swagger-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "2ea19f7a1536a8fad4a6e555ef61ad2f", "sha256": "711ca4b8a354486c2fb78629c1f784f7c603d2c0c361a980c6fceda23c4c0b8a" }, "downloads": -1, "filename": "bottle-swagger-1.0.2.tar.gz", "has_sig": false, "md5_digest": "2ea19f7a1536a8fad4a6e555ef61ad2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5708, "upload_time": "2016-06-02T06:56:59", "url": "https://files.pythonhosted.org/packages/95/40/8162d078f5e9f37df817bdbd6c22d38aece831b56fa3bcdcfd3b4d3eff24/bottle-swagger-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "8ba65ca9f3fcc80d882d88f49e75c231", "sha256": "c1c6d80b9f2e3c15ef64dd04a7e0c2f40e27428fac161fa20a05cafad71182eb" }, "downloads": -1, "filename": "bottle-swagger-1.0.3.tar.gz", "has_sig": false, "md5_digest": "8ba65ca9f3fcc80d882d88f49e75c231", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5824, "upload_time": "2016-06-20T11:16:30", "url": "https://files.pythonhosted.org/packages/88/73/55c6aa654926fa2db191940821b4aaa78c22226c9fffbd48679f9349f6bb/bottle-swagger-1.0.3.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "7eb9cab6141d98611ea4fef8cb58e6d2", "sha256": "d7d06aeb2338dadd3eaba8ef311522f41f79a9fdda967f991acb774b2595b37d" }, "downloads": -1, "filename": "bottle-swagger-1.1.0.tar.gz", "has_sig": false, "md5_digest": "7eb9cab6141d98611ea4fef8cb58e6d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5869, "upload_time": "2016-08-03T22:40:30", "url": "https://files.pythonhosted.org/packages/d2/0c/ac2bbb86b45b711a9d062e724676d51a31e0a2412960e586314748ee4344/bottle-swagger-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "aee50e0fd0ddb68e30b42daf5ec1aff7", "sha256": "ed87c08eb2c0e36bdf5e4c00f7a236625f052a9b241afe03d0d58743fd97dd47" }, "downloads": -1, "filename": "bottle-swagger-1.2.0.tar.gz", "has_sig": false, "md5_digest": "aee50e0fd0ddb68e30b42daf5ec1aff7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6066, "upload_time": "2016-08-22T02:04:35", "url": "https://files.pythonhosted.org/packages/ef/a1/3bb0d20450079d64497572d5d1a50a6fa518bc175ba0d772fa6d82a891e8/bottle-swagger-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aee50e0fd0ddb68e30b42daf5ec1aff7", "sha256": "ed87c08eb2c0e36bdf5e4c00f7a236625f052a9b241afe03d0d58743fd97dd47" }, "downloads": -1, "filename": "bottle-swagger-1.2.0.tar.gz", "has_sig": false, "md5_digest": "aee50e0fd0ddb68e30b42daf5ec1aff7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6066, "upload_time": "2016-08-22T02:04:35", "url": "https://files.pythonhosted.org/packages/ef/a1/3bb0d20450079d64497572d5d1a50a6fa518bc175ba0d772fa6d82a891e8/bottle-swagger-1.2.0.tar.gz" } ] }