{"id":21832305,"url":"https://github.com/hoseungme/typed-express","last_synced_at":"2026-04-12T15:11:19.888Z","repository":{"id":114921215,"uuid":"439687189","full_name":"hoseungme/typed-express","owner":"hoseungme","description":"Make express.js fully-typed and serve automatically generated OpenAPI Specification object","archived":false,"fork":false,"pushed_at":"2022-01-04T16:58:24.000Z","size":1097,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T19:23:01.817Z","etag":null,"topics":["expressjs","nodejs","openapi","server","typescript"],"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/hoseungme.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-12-18T18:28:31.000Z","updated_at":"2022-01-04T16:57:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"a70ab9df-2598-4324-9b23-dbb2d5acd010","html_url":"https://github.com/hoseungme/typed-express","commit_stats":null,"previous_names":["hoseungme/typed-express","hoseungjang/typed-express"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/hoseungme/typed-express","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoseungme%2Ftyped-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoseungme%2Ftyped-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoseungme%2Ftyped-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoseungme%2Ftyped-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoseungme","download_url":"https://codeload.github.com/hoseungme/typed-express/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoseungme%2Ftyped-express/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280734497,"owners_count":26381847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"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":["expressjs","nodejs","openapi","server","typescript"],"created_at":"2024-11-27T19:19:03.948Z","updated_at":"2025-10-24T03:57:35.886Z","avatar_url":"https://github.com/hoseungme.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typed-express\n[![npm version](https://badge.fury.io/js/typed-express.svg)](https://badge.fury.io/js/typed-express)\n[![npm download](https://badgen.net/npm/dt/typed-express)](https://badgen.net/npm/dt/typed-express)\n\nMake express.js fully-typed and serve automatically generated OpenAPI Specification object.\n\n![](/docs/path-params.png)\n![](/docs/query-params.png)\n![](/docs/request-body.png)\n![](/docs/response-body.png)\n\n## Features\n- [Create Routes](#create-routes)\n- [Fully-Typed Request Parameters And Response Body](#fully-typed-request-parameters-and-response-body)\n- [Request Parameters Validation](#request-parameters-validation)\n- [OpenAPI Route](#openapi-route)\n\n## Create Routes\n- use ```Switch``` and ```Route``` to create routes.\n- use ```Parameter``` and ```Schema``` to define request parameter / response body schema.\n- if you need, you can pass middlewares.\n\n```typescript\nexport const PostRouter = new Switch(\"/posts\", [\n  Route.GET(\n    \"/{id}\",\n    \"getPost\",\n    {\n      id: Parameter.Path(Schema.String()),\n    },\n    Schema.Object({\n      id: Schema.String(),\n      title: Schema.String(),\n      content: Schema.String(),\n    }),\n    async (req, res) =\u003e {\n      /* ... */\n    },\n    { middlewares: [/* ... */] } // This is optional\n  )\n]);\n```\n\n## Fully-Typed Request Parameters And Response Body\nrequest parameters and response body type are fully-typed.\n\n## Request Parameters Validation\ntyped-express automatically validates request parameters.\n\nfor example, assume that you define router below,\n\n```typescript\nnew Switch(\"/users\", [\n  Route.GET(\n    \"/{id}\",\n    \"getUser\",\n    {\n      id: Parameter.Path(Schema.Number()),\n    },\n    Schema.Object({\n      id: Schema.String(),\n      name: Schema.String(),\n    }),\n    async (req, res) =\u003e {\n      /* ... */\n    },\n  ),\n]);\n```\n\nand then you create an invalid request like ```GET /users/asdf```, you'll get 400 response with error message(s).\n\n```\nparameter [id]: should be number\n```\n\n## OpenAPI Route\nyou can create OpenAPI Specification and serve it by using ```OpenAPIRoute```.\n\n```typescript\nconst AllRouter = new Switch(\"/\", [\n  PostRouter,\n  CategoryRouter,\n]);\n\nconst OpenAPI = new OpenAPIRoute(\n  \"/openapi\",\n  {\n    title: \"hoseungJangBlogAPI\",\n    version: \"1.0.0\",\n  },\n  AllRouter,\n  Entities\n);\n\nexport const RootRouter = new Switch(\"/\", [\n  OpenAPI,\n  AllRouter,\n]);\n```\n\nif user requests to ```/openapi``` in the code above, OpenAPIRoute returns automatically generated OpenAPI Specification object.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoseungme%2Ftyped-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoseungme%2Ftyped-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoseungme%2Ftyped-express/lists"}