{"id":25423240,"url":"https://github.com/lallenfrancisl/gopi","last_synced_at":"2026-02-12T22:02:04.721Z","repository":{"id":277590152,"uuid":"931491965","full_name":"lallenfrancisl/gopi","owner":"lallenfrancisl","description":"Easy go openapi 3.0 docs generator to use when building APIs","archived":false,"fork":false,"pushed_at":"2025-02-24T20:52:45.000Z","size":44,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-12T04:35:22.882Z","etag":null,"topics":["go","golang","openapi","openapi3","swagger"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/lallenfrancisl/gopi","language":"Go","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/lallenfrancisl.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,"zenodo":null}},"created_at":"2025-02-12T11:19:31.000Z","updated_at":"2025-03-18T17:38:17.000Z","dependencies_parsed_at":"2025-02-14T19:35:23.820Z","dependency_job_id":"802a1f94-ccec-4acc-8519-488033bb9ec9","html_url":"https://github.com/lallenfrancisl/gopi","commit_stats":null,"previous_names":["lallenfrancisl/gopi"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/lallenfrancisl/gopi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lallenfrancisl%2Fgopi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lallenfrancisl%2Fgopi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lallenfrancisl%2Fgopi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lallenfrancisl%2Fgopi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lallenfrancisl","download_url":"https://codeload.github.com/lallenfrancisl/gopi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lallenfrancisl%2Fgopi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29382871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T20:34:40.886Z","status":"ssl_error","status_checked_at":"2026-02-12T20:23:00.490Z","response_time":55,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["go","golang","openapi","openapi3","swagger"],"created_at":"2025-02-16T22:26:55.167Z","updated_at":"2026-02-12T22:02:04.704Z","avatar_url":"https://github.com/lallenfrancisl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gopi (In active development)\n\nA fluent api for building OpenAPI 3.0 schema intuitively. Still in active development, so expect breaking api changes\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/lallenfrancisl/gopi\"\n)\n\nvar docs *gopi.Gopi = gopi.New()\n\nfunc main () {\n\tdocs.\n\t\tTitle(\"Greenlight movie database RESTful API\").\n\t\tDescription(`\n\t\t\tGreenlight is an api for a service like IMDB, where users can\n\t\t\tadd, list and edit details about movies. I built this to learn building\n\t\t\tweb APIs in Go. The api OpenAPI API definition of this was created using\n\t\t\thttps://github.com/lallenfrancisl/gopi, a tool that I made. And the documentation\n\t\t\tUI is rendered using https://scalar.com\n\t\t`).\n\t\tContact(gopi.ContactDef{\n\t\t\tName: \"Allen Francis\",\n\t\t}).\n\t\tVersion(\"1.0.0\").\n\t\tDefineTag(gopi.TagDef{\n\t\t\tName:        \"Movies\",\n\t\t\tDescription: \"APIs for managing movies\",\n\t\t})\n\n    AddDocs()\n\n\tjs, err := docs.MarshalJSONIndent(\"\", \"    \")\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\n\t\treturn\n\t}\n\n\terr = os.WriteFile(\"./docs/swagger.json\", js, os.FileMode(os.O_TRUNC))\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\n\t\treturn\n\t}\n}\n\nfunc AddDocs() {\n\tdocs.Route(\"/v1/movies\").Post().\n\t\tSummary(\"Create a new movie\").\n\t\tTags([]string{\"Movies\"}).\n\t\tBody(\u0026createMoviePayload{}).\n\t\tResponse(\n\t\t\thttp.StatusOK,\n\t\t\tenvelope{\"movie\": \u0026data.Movie{}},\n\t\t)\n\n\tdocs.Route(\"/v1/movies/{id}\").Get().\n\t\tSummary(\"Get a movie by id\").\n\t\tParams(\n\t\t\tgopi.PathParam(\"id\", 0).\n\t\t\t\tDescription(\"Id of the movie\").\n\t\t\t\tRequired(),\n\t\t).\n\t\tTags([]string{\"Movies\"}).\n\t\tResponse(http.StatusOK, envelope{\"movie\": \u0026data.Movie{}})\n\n\tdocs.Route(\"/v1/movies/{id}\").Patch().\n\t\tSummary(\"Update a movie by id\").\n\t\tTags([]string{\"Movies\"}).\n\t\tParams(\n\t\t\tgopi.PathParam(\"id\", 0).\n\t\t\t\tDescription(\"Id of the movie\").\n\t\t\t\tRequired(),\n\t\t).\n\t\tBody(updateMoviePayload{}).\n\t\tResponse(http.StatusOK, envelope{\"movie\": data.Movie{}})\n\n\tdocs.Route(\"/v1/movies/{id}\").Delete().\n\t\tSummary(\"Delete a movie by id\").\n\t\tTags([]string{\"Movies\"}).\n\t\tParams(\n\t\t\tgopi.PathParam(\"id\", 0).\n\t\t\t\tDescription(\"Id of the movie\").\n\t\t\t\tRequired(),\n\t\t).\n\t\tResponse(http.StatusOK, envelope{\"message\": \"\"})\n\n\tdocs.Route(\"/v1/movies\").Get().\n\t\tSummary(\"List all the movies\").\n\t\tTags([]string{\"Movies\"}).\n\t\tParams(\n\t\t\tgopi.QueryParam(\"title\", \"\").\n\t\t\t\tDescription(\"Search by title\"),\n\t\t\tgopi.QueryParam(\"genres\", []string{}).\n\t\t\t\tDescription(\"Filter by list of genres\"),\n\t\t\tgopi.QueryParam(\"page\", 0).\n\t\t\t\tDescription(\"Page number\"),\n\t\t\tgopi.QueryParam(\"page_size\", 0).\n\t\t\t\tDescription(\"Number of items in each page\"),\n\t\t\tgopi.QueryParam(\"sort\", \"\").\n\t\t\t\tDescription(\"Sort by given field name and direction\"),\n\t\t).\n\t\tResponse(\n\t\t\thttp.StatusOK,\n\t\t\tenvelope{\"movies\": []data.Movie{}, \"metadata\": data.Metadata{}},\n\t\t)\n}\n```\n\n## Demo\n\nA live demo of this used along with [Scalar](https://scalar.com) can be seen [here](https://api.allenfrancis.me/greenlight/v1/docs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flallenfrancisl%2Fgopi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flallenfrancisl%2Fgopi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flallenfrancisl%2Fgopi/lists"}