{"id":37379163,"url":"https://github.com/basalam/backbone-api","last_synced_at":"2026-01-16T05:05:28.091Z","repository":{"id":267466802,"uuid":"898332434","full_name":"basalam/backbone-api","owner":"basalam","description":"OpenAPI request and response models","archived":false,"fork":false,"pushed_at":"2025-04-07T09:17:57.000Z","size":42,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-11-27T17:25:40.124Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/basalam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-04T07:54:58.000Z","updated_at":"2025-04-07T09:16:48.000Z","dependencies_parsed_at":"2024-12-10T14:49:39.371Z","dependency_job_id":null,"html_url":"https://github.com/basalam/backbone-api","commit_stats":null,"previous_names":["basalam/backbone-api"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/basalam/backbone-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basalam%2Fbackbone-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basalam%2Fbackbone-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basalam%2Fbackbone-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basalam%2Fbackbone-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/basalam","download_url":"https://codeload.github.com/basalam/backbone-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basalam%2Fbackbone-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-16T05:05:28.015Z","updated_at":"2026-01-16T05:05:28.086Z","avatar_url":"https://github.com/basalam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# backbone-api\nOpenAPI request and response models\n\n#### Installation \u0026 Upgrade\n\n```shell\npip install basalam.backbone-api\n```\n\n#### TODO List\n- [ ] Add Message Toast Field\n- [ ] Add Pagination Query Params Dependency\n\n#### Usage Example\n\n```python\nimport uvicorn\nfrom fastapi import APIRouter\nfrom fastapi import FastAPI\nfrom pydantic import BaseModel\n\nfrom basalam.backbone_api.responses import (\n    ForbiddenResponse,\n    NotFoundResponse,\n    UnauthorizedResponse,\n    UnprocessableContentResponse,\n    BulkResponse, ConflictResponse\n)\n\napp = FastAPI()\n\n\nclass User(BaseModel):\n    id: int\n    name: str\n\n\nrouter = APIRouter(responses={\n    401: {\"model\": UnauthorizedResponse},\n    403: {\"model\": ForbiddenResponse},\n    404: {\"model\": NotFoundResponse},\n    409: {\"model\": ConflictResponse},\n    422: {\"model\": UnprocessableContentResponse}\n})\n\n\n@router.get(\"/\", response_model=BulkResponse[User])\nasync def root():\n    ls = [\n        User(id=1, name=\"John Doe\"),\n        User(id=2, name=\"Jane Boe\")\n    ]\n    return BulkResponse(data=ls).as_json_response()\n\napp.include_router(router)\nif __name__==\"__main__\":\n    uvicorn.run(app, host=\"localhost\", port=8000)\n```\n### Using Exceptions\nin app.py\n\n```python\nfrom fastapi import FastAPI\nfrom basalam.backbone_api.exceptions.client_error.handlers import client_error_exception_handler\nfrom basalam.backbone_api.exceptions.client_error import (\n    ClientErrorException,\n    ForbiddenException,\n    UnauthorizedException,\n    ConflictException,\n    NotFoundException,\n    UnprocessableEntityException\n)\n\napp = FastAPI()\n\nexception_handlers = {\n    ClientErrorException: client_error_exception_handler,\n    ForbiddenException: client_error_exception_handler,\n    UnauthorizedException: client_error_exception_handler,\n    ConflictException: client_error_exception_handler,\n    NotFoundException: client_error_exception_handler,\n    UnprocessableEntityException: client_error_exception_handler,\n}\n\n...\n\n```\nIf you raise any of these exceptions everywhere in you FastAPI project FastAPI will return a client error response\nbased on the excpetion.\n\n### Example Usage\n\n```python\ndef view_or_somthing_else():\n    raise ForbiddenException()\n```\n#### Credits\nThis project was inspired by the work of [Mr.MohammadAli Soltanipoor](https://github.com/soltanipoor) on OpenAPI. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasalam%2Fbackbone-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasalam%2Fbackbone-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasalam%2Fbackbone-api/lists"}