{"id":20606988,"url":"https://github.com/aamalev/aiohttp_apiset","last_synced_at":"2025-04-05T23:06:24.497Z","repository":{"id":1636198,"uuid":"43687975","full_name":"aamalev/aiohttp_apiset","owner":"aamalev","description":"Package to build routes using swagger specification","archived":false,"fork":false,"pushed_at":"2025-03-22T12:07:24.000Z","size":630,"stargazers_count":41,"open_issues_count":7,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T22:09:45.640Z","etag":null,"topics":["aiohttp","asyncio","python"],"latest_commit_sha":null,"homepage":"http://aiohttp-apiset.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aamalev.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-05T14:06:30.000Z","updated_at":"2025-03-22T12:07:27.000Z","dependencies_parsed_at":"2024-06-19T02:41:21.395Z","dependency_job_id":"c13395e1-527c-4a6e-b791-333279445eb8","html_url":"https://github.com/aamalev/aiohttp_apiset","commit_stats":{"total_commits":769,"total_committers":7,"mean_commits":"109.85714285714286","dds":"0.24447334200260074","last_synced_commit":"ddd0d9c03c1d9f0de9e905bbd79c241a853f0f77"},"previous_names":[],"tags_count":90,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamalev%2Faiohttp_apiset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamalev%2Faiohttp_apiset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamalev%2Faiohttp_apiset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamalev%2Faiohttp_apiset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aamalev","download_url":"https://codeload.github.com/aamalev/aiohttp_apiset/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411229,"owners_count":20934653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiohttp","asyncio","python"],"created_at":"2024-11-16T09:35:17.583Z","updated_at":"2025-04-05T23:06:24.481Z","avatar_url":"https://github.com/aamalev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"aiohttp-apiset\n==============\n\n.. image:: https://github.com/aamalev/aiohttp_apiset/workflows/Tests/badge.svg\n  :target: https://github.com/aamalev/aiohttp_apiset/actions?query=workflow%3ATests\n\n.. image:: https://codecov.io/gh/aamalev/aiohttp_apiset/branch/master/graph/badge.svg\n  :target: https://codecov.io/gh/aamalev/aiohttp_apiset\n  :alt: Coverage\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v0.json\n  :target: https://github.com/charliermarsh/ruff\n  :alt: Code style: ruff\n\n.. image:: https://img.shields.io/badge/types-Mypy-blue.svg\n  :target: https://github.com/python/mypy\n  :alt: Code style: Mypy\n\n.. image:: https://img.shields.io/pypi/v/aiohttp_apiset.svg\n  :target: https://pypi.python.org/pypi/aiohttp_apiset\n\n.. image:: https://readthedocs.org/projects/aiohttp-apiset/badge/?version=latest\n  :target: http://aiohttp-apiset.readthedocs.io/en/latest/?badge=latest\n  :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/pyversions/aiohttp_apiset.svg\n  :target: https://pypi.python.org/pypi/aiohttp_apiset\n\n.. image:: https://img.shields.io/pypi/dm/aiohttp-apiset.svg\n  :target: https://pypi.org/project/aiohttp-apiset\n\n.. image:: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg\n  :alt: Hatch project\n  :target: https://github.com/pypa/hatch\n\nPackage to build routes and validate request using swagger specification 2.0.\n\nFeatures\n--------\n\n- Building of the routing from specification swagger\n- Using inclusions other specifications with concatenate url\n- Optional output of the resulting specification and view embed `swagger-ui \u003chttps://github.com/swagger-api/swagger-ui\u003e`_\n- Advanced router with TreeResource\n- Extract specify parameters from request and validate with jsonschema\n- Serialize data as response with middleware\n\nUsecase\n-------\n\nPackage aiohttp_apiset allows supports several strategies:\n\n- The foreign specification. When the specification\n  is made and maintained by another team.\n- The specification in the code. When the fragments of specification\n  are placed in the docstrings.\n- Mixed strategy. When routing are located in the specification files\n  and operations are described in the docstrings.\n\nExample\n-------\n\n.. code-block:: python\n\n  async def handler(request, pet_id):\n      \"\"\"\n      ---\n      tags: [Pet]\n      description: Info about pet\n      parameters:\n        - name: pet_id\n          in: path\n          type: integer\n          minimum: 0\n      responses:\n        200:\n          description: OK\n        400:\n          description: Validation error\n        404:\n          description: Not found\n      \"\"\"\n      pet = await db.pets.find(pet_id)\n\n      if not pet:\n          return {'status': 404, 'msg': 'Not Found'}\n\n      return {\n          'pet': pet,  # dict serialized inside jsonify\n      }\n\n\n  def main():\n      router = SwaggerRouter(\n          swagger_ui='/swagger/',\n          version_ui=2,\n      )\n      router.add_get('/pets/{pet_id}', handler=handler)\n\n      app = web.Application(\n          router=router,\n          middlewares=[jsonify],\n      )\n\n      web.run_app(app)\n\nIs now available in the swagger-ui to the address http://localhost:8080/swagger/.\nAvailable both branch swagger-ui. For use branch 3.x visit http://localhost:8080/swagger/?version=3\n\n\nExamples: `examples \u003chttps://github.com/aamalev/aiohttp_apiset/tree/master/examples\u003e`_\n\n\n\nDevelopment\n-----------\n\nCheck code:\n\n.. code-block:: shell\n\n    hatch run lint:all\n\n\nFormat code:\n\n.. code-block:: shell\n\n    hatch run lint:fmt\n\n\nRun tests:\n\n.. code-block:: shell\n\n    hatch run pytest\n\n\nRun tests with coverage:\n\n.. code-block:: shell\n\n    hatch run cov\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faamalev%2Faiohttp_apiset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faamalev%2Faiohttp_apiset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faamalev%2Faiohttp_apiset/lists"}