{"id":48531564,"url":"https://github.com/yeongseon/azure-functions-openapi","last_synced_at":"2026-04-08T00:01:50.695Z","repository":{"id":291210428,"uuid":"976947624","full_name":"yeongseon/azure-functions-openapi","owner":"yeongseon","description":"OpenAPI (Swagger) documentation and Swagger UI for Azure Functions Python v2 — Part of the Azure Functions Python DX Toolkit","archived":false,"fork":false,"pushed_at":"2026-04-04T12:22:39.000Z","size":7377,"stargazers_count":20,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-04T13:23:41.963Z","etag":null,"topics":["azure","azure-functions","dx-toolkit","openapi","python","serverless","swagger"],"latest_commit_sha":null,"homepage":"https://yeongseon.github.io/azure-functions-openapi/","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/yeongseon.png","metadata":{"files":{"readme":"README.ja.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-05-03T04:31:45.000Z","updated_at":"2026-04-04T12:21:20.000Z","dependencies_parsed_at":"2025-05-25T14:32:24.864Z","dependency_job_id":"1e3af338-2150-4a19-b016-2bb2decd18fa","html_url":"https://github.com/yeongseon/azure-functions-openapi","commit_stats":null,"previous_names":["yeongseon/azure-functions-openapi"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/yeongseon/azure-functions-openapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeongseon%2Fazure-functions-openapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeongseon%2Fazure-functions-openapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeongseon%2Fazure-functions-openapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeongseon%2Fazure-functions-openapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeongseon","download_url":"https://codeload.github.com/yeongseon/azure-functions-openapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeongseon%2Fazure-functions-openapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31533824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["azure","azure-functions","dx-toolkit","openapi","python","serverless","swagger"],"created_at":"2026-04-08T00:01:46.274Z","updated_at":"2026-04-08T00:01:50.668Z","avatar_url":"https://github.com/yeongseon.png","language":"Python","readme":"# Azure Functions OpenAPI\n\n[![PyPI](https://img.shields.io/pypi/v/azure-functions-openapi.svg)](https://pypi.org/project/azure-functions-openapi/)\n[![Python Version](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue)](https://pypi.org/project/azure-functions-openapi/)\n[![CI](https://github.com/yeongseon/azure-functions-openapi/actions/workflows/ci-test.yml/badge.svg)](https://github.com/yeongseon/azure-functions-openapi/actions/workflows/ci-test.yml)\n[![Release](https://github.com/yeongseon/azure-functions-openapi/actions/workflows/release.yml/badge.svg)](https://github.com/yeongseon/azure-functions-openapi/actions/workflows/release.yml)\n[![Security Scans](https://github.com/yeongseon/azure-functions-openapi/actions/workflows/security.yml/badge.svg)](https://github.com/yeongseon/azure-functions-openapi/actions/workflows/security.yml)\n[![codecov](https://codecov.io/gh/yeongseon/azure-functions-openapi/branch/main/graph/badge.svg)](https://codecov.io/gh/yeongseon/azure-functions-openapi)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://pre-commit.com/)\n[![Docs](https://img.shields.io/badge/docs-gh--pages-blue)](https://yeongseon.github.io/azure-functions-openapi/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n他の言語: [English](README.md) | [한국어](README.ko.md) | [简体中文](README.zh-CN.md)\n\n**Azure Functions Python v2 プログラミング モデル**向けの OpenAPI（Swagger）ドキュメント生成と Swagger UI を提供します。\n\n## Why Use It\n\nAzure Functions の HTTP API をドキュメント化するには、通常、別途 OpenAPI スペックを手作業で管理する必要があります。`azure-functions-openapi` はデコレータ付きハンドラーからスペックを自動生成し、ドキュメントとコードの同期を維持します。\n\n## Scope\n\n- Azure Functions Python **v2 プログラミング モデル**\n- decorator ベースの `func.FunctionApp()` アプリケーション\n- `@openapi` で文書化された HTTP トリガー関数\n- オプションの Pydantic スキーマ生成（Pydantic v1 と v2 の両方をサポート）\n\nこのパッケージは従来の `function.json` ベースの v1 プログラミング モデルには対応していません。\n\n## Features\n\n- operation メタデータ用の `@openapi` decorator\n- `/openapi.json`, `/openapi.yaml`, `/docs` エンドポイント\n- query, path, header, body, response スキーマのサポート\n- セキュアなデフォルトを備えた Swagger UI helper\n- 生成および検証ワークフローのための CLI ツール\n\n## Installation\n\n```bash\npip install azure-functions-openapi\n```\n\nFunction App の依存関係には次を含めてください。\n\n```text\nazure-functions\nazure-functions-openapi\n```\n\n## Quick Start\n\n```python\nimport json\n\nimport azure.functions as func\n\nfrom azure_functions_openapi.decorator import openapi\nfrom azure_functions_openapi.openapi import get_openapi_json, get_openapi_yaml\nfrom azure_functions_openapi.swagger_ui import render_swagger_ui\n\n\napp = func.FunctionApp()\n\n\n@app.function_name(name=\"http_trigger\")\n@app.route(route=\"http_trigger\", auth_level=func.AuthLevel.ANONYMOUS, methods=[\"POST\"])\n@openapi(\n    summary=\"Greet user\",\n    route=\"/api/http_trigger\",\n    method=\"post\",\n    request_body={\n        \"type\": \"object\",\n        \"properties\": {\"name\": {\"type\": \"string\"}},\n        \"required\": [\"name\"],\n    },\n    response={\n        200: {\n            \"description\": \"Successful greeting\",\n            \"content\": {\n                \"application/json\": {\n                    \"schema\": {\n                        \"type\": \"object\",\n                        \"properties\": {\"message\": {\"type\": \"string\"}},\n                    }\n                }\n            },\n        }\n    },\n    tags=[\"Example\"],\n)\ndef http_trigger(req: func.HttpRequest) -\u003e func.HttpResponse:\n    data = req.get_json()\n    name = data.get(\"name\", \"world\")\n    return func.HttpResponse(\n        json.dumps({\"message\": f\"Hello, {name}!\"}),\n        mimetype=\"application/json\",\n    )\n\n@app.function_name(name=\"openapi_json\")\n@app.route(route=\"openapi.json\", auth_level=func.AuthLevel.ANONYMOUS, methods=[\"GET\"])\ndef openapi_json(req: func.HttpRequest) -\u003e func.HttpResponse:\n    return func.HttpResponse(\n        get_openapi_json(\n            title=\"Sample API\",\n            description=\"OpenAPI document for the Sample API.\",\n        ),\n        mimetype=\"application/json\",\n    )\n\n\n@app.function_name(name=\"openapi_yaml\")\n@app.route(route=\"openapi.yaml\", auth_level=func.AuthLevel.ANONYMOUS, methods=[\"GET\"])\ndef openapi_yaml(req: func.HttpRequest) -\u003e func.HttpResponse:\n    return func.HttpResponse(\n        get_openapi_yaml(\n            title=\"Sample API\",\n            description=\"OpenAPI document for the Sample API.\",\n        ),\n        mimetype=\"application/x-yaml\",\n    )\n\n\n@app.function_name(name=\"swagger_ui\")\n@app.route(route=\"docs\", auth_level=func.AuthLevel.ANONYMOUS, methods=[\"GET\"])\ndef swagger_ui(req: func.HttpRequest) -\u003e func.HttpResponse:\n    return render_swagger_ui()\n```\n\nローカルでは Azure Functions Core Tools で実行できます。\n\n```bash\nfunc start\n```\n\n## Demo\n\n代表的な `hello` サンプルは、このライブラリを導入したときの結果全体を示します。\n\n- Azure Functions v2 の HTTP ハンドラーに `@openapi` を付与します。\n- パッケージがそのルートに対する実際の OpenAPI ドキュメントを生成します。\n- 同じルートがブラウザ確認用に Swagger UI でレンダリングされます。\n\n### Generated Spec Result\n\n生成された OpenAPI ファイルは、同じサンプル実行から静的プレビューとして取得されています。そのため、この README には代表的な関数が実際に生成したドキュメントが表示されます。\n\n![OpenAPI spec preview](docs/assets/hello_openapi_spec_preview.png)\n\n### Swagger UI Result\n\n以下の Web プレビューも同じ代表サンプルから生成されており、そのフローで作られた Swagger UI ページを自動的にレンダリングして取得したものです。\n\n![OpenAPI Swagger UI preview](docs/assets/hello_openapi_swagger_ui_preview.png)\n\n## Documentation\n\n- 全ドキュメント: [yeongseon.github.io/azure-functions-openapi](https://yeongseon.github.io/azure-functions-openapi/)\n- スモークテスト済みサンプル: `examples/`\n- [Installation Guide](docs/installation.md)\n- [Usage Guide](docs/usage.md)\n- [API Reference](docs/api.md)\n- [CLI Guide](docs/cli.md)\n\n## Ecosystem\n\n- [azure-functions-langgraph](https://github.com/yeongseon/azure-functions-langgraph) — LangGraph デプロイアダプター\n- [azure-functions-validation](https://github.com/yeongseon/azure-functions-validation) — リクエストとレスポンスのバリデーション\n- [azure-functions-logging](https://github.com/yeongseon/azure-functions-logging) — 構造化ロギング\n- [azure-functions-doctor](https://github.com/yeongseon/azure-functions-doctor) — 診断 CLI\n- [azure-functions-scaffold](https://github.com/yeongseon/azure-functions-scaffold) — プロジェクトスキャフォールディング\n- [azure-functions-durable-graph](https://github.com/yeongseon/azure-functions-durable-graph) — Durable Functions ベースのグラフランタイム\n- [azure-functions-python-cookbook](https://github.com/yeongseon/azure-functions-python-cookbook) — レシピとサンプル\n\n## Disclaimer\n\nこのプロジェクトは独立したコミュニティプロジェクトであり、Microsoft と提携・承認・保守関係にはありません。\n\nAzure および Azure Functions は Microsoft Corporation の商標です。\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeongseon%2Fazure-functions-openapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeongseon%2Fazure-functions-openapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeongseon%2Fazure-functions-openapi/lists"}