[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10287":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":42,"readmeContent":43,"aiSummary":44,"trendingCount":16,"starSnapshotCount":16,"syncStatus":45,"lastSyncTime":46,"discoverSource":47},10287,"huma","danielgtaylor\u002Fhuma","danielgtaylor","Huma REST\u002FHTTP API Framework for Golang with OpenAPI 3.1","https:\u002F\u002Fhuma.rocks\u002F",null,"Go",4159,269,27,94,0,17,97,7,29.29,"MIT License",false,"main",true,[26,27,28,29,30,31,32,5,33,34,35,36,37,38,39,40,41],"api","documentation","fastapi","framework","golang","golang-library","hacktoberfest","json-schema","openapi","openapi-server","openapi3","openapi31","rest","rest-api","swagger-ui","web","2026-06-12 02:02:19","\u003Ca href=\"#\">\n\t\u003Cpicture>\n\t\t\u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fhuma.rocks\u002Fhuma-dark.png\" \u002F>\n\t\t\u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Fhuma.rocks\u002Fhuma.png\" \u002F>\n\t\t\u003Cimg alt=\"Huma Logo\" src=\"https:\u002F\u002Fhuma.rocks\u002Fhuma.png\" \u002F>\n\t\u003C\u002Fpicture>\n\u003C\u002Fa>\n\n[![HUMA Powered](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPowered%20By-HUMA-f40273)](https:\u002F\u002Fhuma.rocks\u002F) [![CI](https:\u002F\u002Fgithub.com\u002Fdanielgtaylor\u002Fhuma\u002Fworkflows\u002FCI\u002Fbadge.svg?branch=main)](https:\u002F\u002Fgithub.com\u002Fdanielgtaylor\u002Fhuma\u002Factions?query=workflow%3ACI+branch%3Amain++) [![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fdanielgtaylor\u002Fhuma\u002Fbranch\u002Fmain\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fdanielgtaylor\u002Fhuma) [![Docs](https:\u002F\u002Fgodoc.org\u002Fgithub.com\u002Fdanielgtaylor\u002Fhuma\u002Fv2?status.svg)](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fdanielgtaylor\u002Fhuma\u002Fv2?tab=doc) [![Go Report Card](https:\u002F\u002Fgoreportcard.com\u002Fbadge\u002Fgithub.com\u002Fdanielgtaylor\u002Fhuma\u002Fv2)](https:\u002F\u002Fgoreportcard.com\u002Freport\u002Fgithub.com\u002Fdanielgtaylor\u002Fhuma\u002Fv2)\n\n[**🌎中文文档**](.\u002FREADME_CN.md)\n[**🇯🇵日本語ドキュメント**](.\u002FREADME_JA.md)\n\n- [What is huma?](#intro)\n- [Install](#install)\n- [Example](#example)\n- [Documentation](#documentation)\n\n\u003Ca name=\"intro\">\u003C\u002Fa>\nA modern, simple, fast & flexible micro framework for building HTTP REST\u002FRPC APIs in Go backed by OpenAPI 3 and JSON Schema. Pronounced IPA: [\u002F'hjuːmɑ\u002F](https:\u002F\u002Fen.wiktionary.org\u002Fwiki\u002FWiktionary:International_Phonetic_Alphabet). The goals of this project are to provide:\n\n- Incremental adoption for teams with existing services\n  - Bring your own router (including Go 1.22+), middleware, and logging\u002Fmetrics\n  - Extensible OpenAPI & JSON Schema layer to document existing routes\n- A modern REST or HTTP RPC API backend framework for Go developers\n  - Described by [OpenAPI 3.1](https:\u002F\u002Fgithub.com\u002FOAI\u002FOpenAPI-Specification\u002Fblob\u002Fmaster\u002Fversions\u002F3.1.0.md) & [JSON Schema](https:\u002F\u002Fjson-schema.org\u002F)\n- Guard rails to prevent common mistakes\n- Documentation that can't get out of date\n- High-quality generated developer tooling\n\nFeatures include:\n\n- Declarative interface on top of your router of choice:\n  - Operation & model documentation\n  - Request params (path, query, header, or cookie)\n  - Request body\n  - Responses (including errors)\n  - Response headers\n- JSON Errors using [RFC9457](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc9457) and `application\u002Fproblem+json` by default (but can be changed)\n- Per-operation request size limits with sane defaults\n- [Content negotiation](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FHTTP\u002FContent_negotiation) between server and client\n  - Support for JSON ([RFC 8259](https:\u002F\u002Ftools.ietf.org\u002Fhtml\u002Frfc8259)) and optionally CBOR ([RFC 7049](https:\u002F\u002Ftools.ietf.org\u002Fhtml\u002Frfc7049)) content types via the `Accept` header with the default config.\n- Conditional requests support, e.g. `If-Match` or `If-Unmodified-Since` header utilities.\n- Optional automatic generation of `PATCH` operations that support:\n  - [RFC 7386](https:\u002F\u002Fwww.rfc-editor.org\u002Frfc\u002Frfc7386) JSON Merge Patch\n  - [RFC 6902](https:\u002F\u002Fwww.rfc-editor.org\u002Frfc\u002Frfc6902) JSON Patch\n  - [Shorthand](https:\u002F\u002Fgithub.com\u002Fdanielgtaylor\u002Fshorthand) patches\n- Annotated Go types for input and output models\n  - Generates JSON Schema from Go types\n  - Static typing for path\u002Fquery\u002Fheader params, bodies, response headers, etc.\n  - Automatic input model validation & error handling\n- Documentation generation using [Stoplight Elements](https:\u002F\u002Fstoplight.io\u002Fopen-source\u002Felements)\n- Optional CLI built-in, configured via arguments or environment variables\n  - Set via e.g. `-p 8000`, `--port=8000`, or `SERVICE_PORT=8000`\n  - Startup actions & graceful shutdown built-in\n- Generates OpenAPI for access to a rich ecosystem of tools\n  - Mocks with [API Sprout](https:\u002F\u002Fgithub.com\u002Fdanielgtaylor\u002Fapisprout) or [Prism](https:\u002F\u002Fstoplight.io\u002Fopen-source\u002Fprism)\n  - SDKs with [OpenAPI Generator](https:\u002F\u002Fgithub.com\u002FOpenAPITools\u002Fopenapi-generator) or [oapi-codegen](https:\u002F\u002Fgithub.com\u002Fdeepmap\u002Foapi-codegen)\n  - CLI with [Restish](https:\u002F\u002Frest.sh\u002F)\n  - And [plenty](https:\u002F\u002Fopenapi.tools\u002F) [more](https:\u002F\u002Fapis.guru\u002Fawesome-openapi3\u002Fcategory.html)\n- Generates JSON Schema for each resource using optional `describedby` link relation headers as well as optional `$schema` properties in returned objects that integrate into editors for validation & completion.\n\nThis project was inspired by [FastAPI](https:\u002F\u002Ffastapi.tiangolo.com\u002F). Logo & branding designed by Kari Taylor.\n\n## Sponsors\n\nA big thank you to our current & former sponsors!\n\n\u003Cdiv>\n\t\t\t\t\t\u003Cimg width=\"1000\" height=\"0\" \u002F>\n\t\t\t\t\t\u003Ca href=\"https:\u002F\u002Fzuplo.link\u002Fhuma-gh \">\n\t\t\t\t\t\u003Cpicture>\n\t\t\t\t\t\t\t\u003C!-- \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fzuplo-dark.png\"> -->\n\t\t\t\t\t\t\t\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Faace5aa7-32bd-45cf-a8f8-2e352feaf017\" alt=\"Zuplo\" width=\"260\" align=\"right\">\n\t\t\t\t\t\u003C\u002Fpicture>\n\t\t\t\t\t\u003C\u002Fa>\n\t\t\t\t\t\u003Ch3>Zuplo: Scale, Protect, and Productize your Huma API\u003C\u002Fh3>\n\t\t\t\t\t\u003Cp>\n\t\t\t\t\t\t\tOur API Gateway allows you to secure your API, scale it globally, generate documentation from your OpenAPI, and monetize your users.\n\t\t\t\t\t\u003C\u002Fp>\n\t\t\t\t\t\u003Ca href=\"https:\u002F\u002Fzuplo.link\u002Fhuma-gh \">Start for Free\u003C\u002Fa>\n\u003C\u002Fdiv>\n\u003Chr\u002F>\n\n- [@bclements](https:\u002F\u002Fgithub.com\u002Fbclements)\n- [@bekabaz](https:\u002F\u002Fgithub.com\u002Fbekabaz)\n- [@victoraugustolls](https:\u002F\u002Fgithub.com\u002Fvictoraugustolls)\n- [@phoenixtechnologies-io](https:\u002F\u002Fgithub.com\u002Fphoenixtechnologies-io)\n- [@chenjr0719](https:\u002F\u002Fgithub.com\u002Fchenjr0719)\n- [@vinogradovkonst](https:\u002F\u002Fgithub.com\u002Fvinogradovkonst)\n- [@miyamo2](https:\u002F\u002Fgithub.com\u002Fmiyamo2)\n- [@nielskrijger](https:\u002F\u002Fgithub.com\u002Fnielskrijger)\n\n## Testimonials\n\n> This is by far my favorite web framework for Go. It is inspired by FastAPI, which is also amazing, and conforms to many RFCs for common web things ... I really like the feature set, the fact that it [can use] Chi, and the fact that it is still somehow relatively simple to use. I've tried other frameworks and they do not spark joy for me. - [Jeb_Jenky](https:\u002F\u002Fwww.reddit.com\u002Fr\u002Fgolang\u002Fcomments\u002Fzhitcg\u002Fcomment\u002Fizmg6vk\u002F?utm_source=reddit&utm_medium=web2x&context=3)\n\n> After working with #Golang for over a year, I stumbled upon Huma, the #FastAPI-inspired web framework. It’s the Christmas miracle I’ve been hoping for! This framework has everything! - [Hana Mohan](https:\u002F\u002Ftwitter.com\u002Funamashana\u002Fstatus\u002F1733088066053583197)\n\n> I love Huma. Thank you, sincerely, for this awesome package. I’ve been using it for some time now and it’s been great! - [plscott](https:\u002F\u002Fwww.reddit.com\u002Fr\u002Fgolang\u002Fcomments\u002F1aoshey\u002Fcomment\u002Fkq6hcpd\u002F?utm_source=reddit&utm_medium=web2x&context=3)\n\n> Thank you Daniel for Huma. Superbly useful project and saves us a lot of time and hassle thanks to the OpenAPI gen — similar to FastAPI in Python. - [WolvesOfAllStreets](https:\u002F\u002Fwww.reddit.com\u002Fr\u002Fgolang\u002Fcomments\u002F1aqj99d\u002Fcomment\u002Fkqfqcml\u002F?utm_source=reddit&utm_medium=web2x&context=3)\n\n> Huma is wonderful, I've started working with it recently, and it's a pleasure, so thank you very much for your efforts 🙏 - [callmemicah](https:\u002F\u002Fwww.reddit.com\u002Fr\u002Fgolang\u002Fcomments\u002F1b32ts4\u002Fcomment\u002Fksvr9h7\u002F?utm_source=reddit&utm_medium=web2x&context=3)\n\n> It took us 3 months to build our platform in Python with FastAPI, SQL Alchemy and only 3 weeks to rewrite it in Go with Huma and SQL C. Things just work and I seldomly have to debug where in Python I spent a majority of my time debugging. - [Bitclick\\_](https:\u002F\u002Fwww.reddit.com\u002Fr\u002Fgolang\u002Fcomments\u002F1cj2znb\u002Fcomment\u002Fl2e4u6y\u002F)\n\n> Look at Huma, it's great. A nice slim layer on top of stdlib mux\u002Fchi and automatic body and parameter serialization, kinda feels like doing dotnet web APIs, but forces you to actually design request and response structs, which is great imo. - [Kirides](https:\u002F\u002Fwww.reddit.com\u002Fr\u002Fgolang\u002Fcomments\u002F1fnn5c2\u002Fcomment\u002Flokuvpo\u002F)\n\n# Install\n\nInstall via `go get`. Note that Go 1.25 or newer is required.\n\n```sh\n# After: go mod init ...\ngo get -u github.com\u002Fdanielgtaylor\u002Fhuma\u002Fv2\n```\n\n# Example\n\nHere is a complete basic hello world example in Huma, that shows how to initialize a Huma app complete with CLI, declare a resource operation, and define its handler function.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\u002Fhttp\"\n\n\t\"github.com\u002Fdanielgtaylor\u002Fhuma\u002Fv2\"\n\t\"github.com\u002Fdanielgtaylor\u002Fhuma\u002Fv2\u002Fadapters\u002Fhumachi\"\n\t\"github.com\u002Fdanielgtaylor\u002Fhuma\u002Fv2\u002Fhumacli\"\n\t\"github.com\u002Fgo-chi\u002Fchi\u002Fv5\"\n\n\t_ \"github.com\u002Fdanielgtaylor\u002Fhuma\u002Fv2\u002Fformats\u002Fcbor\"\n)\n\n\u002F\u002F Options for the CLI. Pass `--port` or set the `SERVICE_PORT` env var.\ntype Options struct {\n\tPort int `help:\"Port to listen on\" short:\"p\" default:\"8888\"`\n}\n\n\u002F\u002F GreetingOutput represents the greeting operation response.\ntype GreetingOutput struct {\n\tBody struct {\n\t\tMessage string `json:\"message\" example:\"Hello, world!\" doc:\"Greeting message\"`\n\t}\n}\n\nfunc main() {\n\t\u002F\u002F Create a CLI app which takes a port option.\n\tcli := humacli.New(func(hooks humacli.Hooks, options *Options) {\n\t\t\u002F\u002F Create a new router & API\n\t\trouter := chi.NewMux()\n\t\tapi := humachi.New(router, huma.DefaultConfig(\"My API\", \"1.0.0\"))\n\n\t\t\u002F\u002F Add the operation handler to the API.\n\t\thuma.Get(api, \"\u002Fgreeting\u002F{name}\", func(ctx context.Context, input *struct{\n\t\t\tName string `path:\"name\" maxLength:\"30\" example:\"world\" doc:\"Name to greet\"`\n\t\t}) (*GreetingOutput, error) {\n\t\t\tresp := &GreetingOutput{}\n\t\t\tresp.Body.Message = fmt.Sprintf(\"Hello, %s!\", input.Name)\n\t\t\treturn resp, nil\n\t\t})\n\n\t\t\u002F\u002F Tell the CLI how to start your router.\n\t\thooks.OnStart(func() {\n\t\t\thttp.ListenAndServe(fmt.Sprintf(\":%d\", options.Port), router)\n\t\t})\n\t})\n\n\t\u002F\u002F Run the CLI. When passed no commands, it starts the server.\n\tcli.Run()\n}\n```\n\n> [!TIP]\n> Replace `chi.NewMux()` → `http.NewServeMux()` and `humachi.New` → `humago.New` to use the standard library router from Go 1.22+. Just make sure your `go.mod` has `go 1.22` or newer listed in it. Everything else stays the same! Switch whenever you are ready.\n\nYou can test it with `go run greet.go` (optionally pass `--port` to change the default) and make a sample request using [Restish](https:\u002F\u002Frest.sh\u002F) (or `curl`):\n\n```sh\n# Get the message from the server\n$ restish :8888\u002Fgreeting\u002Fworld\nHTTP\u002F1.1 200 OK\n...\n{\n\t$schema: \"http:\u002F\u002Flocalhost:8888\u002Fschemas\u002FGreetingOutputBody.json\",\n\tmessage: \"Hello, world!\"\n}\n```\n\nEven though the example is tiny you can also see some generated documentation at http:\u002F\u002Flocalhost:8888\u002Fdocs. The generated OpenAPI is available at http:\u002F\u002Flocalhost:8888\u002Fopenapi.json or http:\u002F\u002Flocalhost:8888\u002Fopenapi.yaml.\n\nCheck out the [Huma tutorial](https:\u002F\u002Fhuma.rocks\u002Ftutorial\u002Finstallation\u002F) for a step-by-step guide to get started.\n\n# Documentation\n\nSee the [https:\u002F\u002Fhuma.rocks\u002F](https:\u002F\u002Fhuma.rocks\u002F) website for full documentation in a presentation that's easier to navigate and search then this README. You can find the source for the site in the `docs` directory of this repo.\n\nOfficial Go package documentation can always be found at https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fdanielgtaylor\u002Fhuma\u002Fv2.\n\n# Articles & Mentions\n\n- [APIs in Go with Huma 2.0](https:\u002F\u002Fdgt.hashnode.dev\u002Fapis-in-go-with-huma-20)\n- [Reducing Go Dependencies: A case study of dependency reduction in Huma](https:\u002F\u002Fdgt.hashnode.dev\u002Freducing-go-dependencies)\n- [Golang News & Libs & Jobs shared on Twitter\u002FX](https:\u002F\u002Ftwitter.com\u002Fgolangch\u002Fstatus\u002F1752175499701264532)\n- Featured in Go Weekly [#495](https:\u002F\u002Fgolangweekly.com\u002Fissues\u002F495) & [#498](https:\u002F\u002Fgolangweekly.com\u002Fissues\u002F498)\n- [Bump.sh Deploying Docs from Huma](https:\u002F\u002Fdocs.bump.sh\u002Fguides\u002Fbump-sh-tutorials\u002Fhuma\u002F)\n- Mentioned in [Composable HTTP Handlers Using Generics](https:\u002F\u002Fwww.willem.dev\u002Farticles\u002Fgeneric-http-handlers\u002F)\n\n# Who is using Huma?\n\nHuma is used by many companies and open-source projects. See the [Who is using Huma?](https:\u002F\u002Fhuma.rocks\u002Fwhy\u002F#who-is-using-huma) page for a list!\n\nBe sure to star the project if you find it useful!\n\n\u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#danielgtaylor\u002Fhuma&Date\">\n\t\u003Cpicture>\n\t\t\u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=danielgtaylor\u002Fhuma&type=Date&theme=dark\" \u002F>\n\t\t\u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=danielgtaylor\u002Fhuma&type=Date\" \u002F>\n\t\t\u003Cimg alt=\"Star History Chart\" src=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=danielgtaylor\u002Fhuma&type=Date\" \u002F>\n\t\u003C\u002Fpicture>\n\u003C\u002Fa>\n","Huma 是一个用于构建 Go 语言 HTTP REST\u002FRPC API 的现代、简单、快速且灵活的微框架，支持 OpenAPI 3.1 和 JSON Schema。其核心功能包括声明式接口定义、请求参数和响应处理、JSON 错误格式化（默认使用 `application\u002Fproblem+json`）、请求大小限制、内容协商以及条件请求支持。此外，Huma 还提供了自动生成的补丁操作，支持 JSON Merge Patch 和 JSON Patch 标准。该框架非常适合需要逐步引入新服务或希望为现有服务添加文档的团队，同时也适用于从零开始构建现代化 REST 或 HTTP RPC API 后端的 Go 开发者。",2,"2026-06-11 03:27:35","top_topic"]