{ "info": { "author": "Brunoais", "author_email": "brunoaiss@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "# apispec-clear-unusable\n\nPlugin for apispec which helps reusing the documentation on a muti-endpoint function/method.\n\n## Example with flask-restful\n\n```python\nfrom apispec import APISpec\nfrom flask import Flask, jsonify\nfrom flask_restful import Resource, Api\nfrom marshmallow import Schema, fields\n\n# Create an APISpec\nspec = APISpec(\n title='Random swagger Petstore',\n version='1.0.0',\n plugins=[\n 'apispec.ext.flask',\n 'apispec.ext.marshmallow',\n 'brunoais.apispec.ext.clear_unusable',\n ],\n)\n\n# This example uses flask but it also works with other frameworks\napp = Flask(__name__)\napi = Api(app)\n\nclass RandomPet(Resource):\n\n def get(self, species=None, race=None):\n \"\"\"A cute random furry animal.\n ---\n description: Get a random pet\n parameters:\n - in: path\n name: species\n type: string\n description: The species of the animal to be randomly selected\n parameters:\n - in: path\n name: race\n type: string\n description: The race of the animal to be randomly selected\n responses:\n 200:\n description: A pet to be returned\n schema: PetSchema\n \"\"\"\n return get_random_pet(species=species, race=race), 200\n\n\napi.add_resource(RandomPet, '/pets/random', endpoint='randompet')\napi.add_resource(RandomPet, '/pets//random', endpoint='randompet_species')\napi.add_resource(RandomPet, '/pets//races//random', endpoint='randompet_species_race')\n\nspec.definition('Category', schema=CategorySchema)\nspec.definition('Pet', schema=PetSchema)\n\nwith app.test_request_context():\n spec.add_path(view=random_pet)\n```\nOutput becomes\n```\ndefinitions:\n\t#...\nparameters: {}\npaths:\n /pets/random:\n get:\n description: Get a random pet\n parameters: []\n responses:\n 200:\n description: A pet to be returned\n schema: {$ref: '#/definitions/Pet'}\n /pets/{species}/random:\n get:\n description: Get a random pet\n parameters:\n - {description: The species of the animal to be randomly selected, in: path,\n name: species, required: true, type: string}\n responses:\n 200:\n description: A pet to be returned\n schema: {$ref: '#/definitions/Pet'}\n /pets/{species}/races/{race}/random:\n get:\n description: Get a random pet\n parameters:\n - {description: The species of the animal to be randomly selected, in: path,\n name: species, required: true, type: string}\n - {description: The race of the animal to be randomly selected, in: path, name: race,\n required: true, type: string}\n responses:\n 200:\n description: A pet to be returned\n schema: {$ref: '#/definitions/Pet'}\nswagger: '2.0'\n```\n\n## Installation\n\n pip install apispec-clear-unusable\n\n## License\n\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/brunoais/apispec-clear-unusable", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "apispec-clear-unusable", "package_url": "https://pypi.org/project/apispec-clear-unusable/", "platform": "", "project_url": "https://pypi.org/project/apispec-clear-unusable/", "project_urls": { "Homepage": "https://github.com/brunoais/apispec-clear-unusable" }, "release_url": "https://pypi.org/project/apispec-clear-unusable/1.0.1/", "requires_dist": [ "apispec" ], "requires_python": "", "summary": "Plugin for apispec which helps reusing the documentation on a muti-endpoint function/method.", "version": "1.0.1" }, "last_serial": 4039195, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "21d039c97183b9818465c4f326774d03", "sha256": "e343ae9e70a9e7ce436ca10e2d4e03faf3398240ddf32f664c1c715cda862a61" }, "downloads": -1, "filename": "apispec_clear_unusable-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "21d039c97183b9818465c4f326774d03", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3719, "upload_time": "2018-06-21T17:03:24", "url": "https://files.pythonhosted.org/packages/d9/36/21a0d74ac648a0fa3ad265d8b171b53a4a86b15a0335b9566ef8c9aa2f23/apispec_clear_unusable-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aa7e74f91e1ffba810568c37ff5348bc", "sha256": "69ac9723b76f9cddc6fb119a290f57280ff12d1f65ce65e1e61ab24b5c135d8d" }, "downloads": -1, "filename": "apispec-clear-unusable-1.0.0.tar.gz", "has_sig": false, "md5_digest": "aa7e74f91e1ffba810568c37ff5348bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3579, "upload_time": "2018-06-21T17:03:25", "url": "https://files.pythonhosted.org/packages/80/26/65e9b9318483f2c9a7ff08d3a6bf4eb91e3ce4b85b602c056a54af13a485/apispec-clear-unusable-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "2a5cad943ec0c2fd8f31afc41040c993", "sha256": "8bf26472d0785edbed407cf05b80c06909a808e09da350af12ecd9cd8b3a89d9" }, "downloads": -1, "filename": "apispec_clear_unusable-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2a5cad943ec0c2fd8f31afc41040c993", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3712, "upload_time": "2018-07-07T17:28:35", "url": "https://files.pythonhosted.org/packages/bc/66/24db73cae0056cb96b08fd60387e8df8c72ff5a365b07edc671df426ed88/apispec_clear_unusable-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dc7c93e789b7ac872e749c21e91d9c3f", "sha256": "68afb78ebc93299ee96798d8d87fdd805a3997e2f5aa3df4276d5cd3a44211b4" }, "downloads": -1, "filename": "apispec-clear-unusable-1.0.1.tar.gz", "has_sig": false, "md5_digest": "dc7c93e789b7ac872e749c21e91d9c3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3576, "upload_time": "2018-07-07T17:28:37", "url": "https://files.pythonhosted.org/packages/df/9c/02b5b81dfad5264eefe263701c86be38756f006e10fa7c2d44c1e70fad46/apispec-clear-unusable-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2a5cad943ec0c2fd8f31afc41040c993", "sha256": "8bf26472d0785edbed407cf05b80c06909a808e09da350af12ecd9cd8b3a89d9" }, "downloads": -1, "filename": "apispec_clear_unusable-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2a5cad943ec0c2fd8f31afc41040c993", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3712, "upload_time": "2018-07-07T17:28:35", "url": "https://files.pythonhosted.org/packages/bc/66/24db73cae0056cb96b08fd60387e8df8c72ff5a365b07edc671df426ed88/apispec_clear_unusable-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dc7c93e789b7ac872e749c21e91d9c3f", "sha256": "68afb78ebc93299ee96798d8d87fdd805a3997e2f5aa3df4276d5cd3a44211b4" }, "downloads": -1, "filename": "apispec-clear-unusable-1.0.1.tar.gz", "has_sig": false, "md5_digest": "dc7c93e789b7ac872e749c21e91d9c3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3576, "upload_time": "2018-07-07T17:28:37", "url": "https://files.pythonhosted.org/packages/df/9c/02b5b81dfad5264eefe263701c86be38756f006e10fa7c2d44c1e70fad46/apispec-clear-unusable-1.0.1.tar.gz" } ] }