{"id":22138389,"url":"https://github.com/takeruun/go-typescript-openapi","last_synced_at":"2026-04-27T12:02:49.520Z","repository":{"id":47300013,"uuid":"514995588","full_name":"takeruun/go-typescript-OpenAPI","owner":"takeruun","description":"backend Go (echo), frontend TypeScript(react) schema-driven development","archived":false,"fork":false,"pushed_at":"2022-08-30T15:34:14.000Z","size":4434,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T10:34:15.422Z","etag":null,"topics":["openapi","swagger"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takeruun.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-18T01:16:05.000Z","updated_at":"2022-08-30T15:35:51.000Z","dependencies_parsed_at":"2023-01-16T16:45:39.823Z","dependency_job_id":null,"html_url":"https://github.com/takeruun/go-typescript-OpenAPI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/takeruun/go-typescript-OpenAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takeruun%2Fgo-typescript-OpenAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takeruun%2Fgo-typescript-OpenAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takeruun%2Fgo-typescript-OpenAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takeruun%2Fgo-typescript-OpenAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takeruun","download_url":"https://codeload.github.com/takeruun/go-typescript-OpenAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takeruun%2Fgo-typescript-OpenAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32335297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["openapi","swagger"],"created_at":"2024-12-01T20:09:49.069Z","updated_at":"2026-04-27T12:02:49.503Z","avatar_url":"https://github.com/takeruun.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 概要\nGo のコード生成ツール（oapi-codegen）\n\nTypeScript のコード生成ツール（openapitools/openapi-generator-cli）\n\nの検証\n\n# 環境\n- go 1.18.4\n- oapi-codegen 1.10.0\n- air\n- echo\n- react 18\n- typescript\n\n## 使い方\n1. OpenAPIスキーマを定義\n\n2. `make generate-openapi` を実行 (docker コンテナ内)\n\n    types, server, spec の生成\n  \n    types: データ型の定義（OpenAPIで使用されるデータ型・APIレスポンス型など）\n  \n    server: サーバー設定（ルーティン・APIリクエストの受け口など）\n    \n    spec: リクエストのバリデーションチェック（リクエストパラメータが正常かどうかなど）\n\n3. 実行関数インターフェース追記\n`repository.go` に Api Response型 を返すような関数を定義\n\n4. 実行関数実装\n実行関数インターフェースに定義されてある、関数の実装\n\n## (TypeScript)\n```\ndocker run --rm -v ${PWD}:/app openapitools/openapi-generator-cli:v6.0.0 generate -i /app/docs/openapi.yml -g typescript-fetch -o app/front/src/@codegen/api -c /app/docs/front_generate_config.yml\n```\nプロジェクトロートディレクトで実行。(docker コンテナ外)\n\n### memo\n感想\n\n・userコントロール・orderコントロールという風に一定の括りでまとめるのが難しいので、管理が大変。\n\n・tagで出力を制御できるがパッケージを変える必要がある\n  → 同じ型がtag毎で定義生成されてしまう。\n\nspecのみ使用なら良さそう。\n\nリクエストパラメータのバリデーションチェック良い、使用方法もそんなに難しくない。\n```\ne.Use(echomiddleware.OapiRequestValidator(swagger))\n```\n\nopenapitools/openapi-generator-cli はあり\n\n・FetchAPI クラスを作成してくれて、使用時は呼び出すだけ\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakeruun%2Fgo-typescript-openapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakeruun%2Fgo-typescript-openapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakeruun%2Fgo-typescript-openapi/lists"}