[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71B7H5G7DJ6SZ5ZWC3WVRQE":3,"skill-same:01M71B7H5G7DJ6SZ5ZWC3WVRQE":89},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":58,"commitSha":59,"skillDirectory":60,"forksCount":61,"repositoryHtmlUrl":62,"repositoryHomepageUrl":6,"ownerHtmlUrl":63,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":64,"install":65,"resources":78},"01M71B7H5G7DJ6SZ5ZWC3WVRQE","swagger-typescript-api-es",null,"Guide for using swagger-typescript-api-es — a CLI and Node.js tool that generates TypeScript API clients from Swagger\u002FOpenAPI schemas (ESM rewrite). Use when user asks to generate TypeScript API types from Swagger or OpenAPI, auto-generate axios or fetch HTTP client from swagger.json, set up swagger-typescript-api.config.ts, run gen-api-types script, or use swagger-typescript-api-es CLI.","erwin-flores-ucb\u002Fproyecto-hoteles","erwin-flores-ucb","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F202312064?v=4","01M71B75B0TEMN5161E7FNXHV3","Erwin Ramiro Flores Marca","01M71B75BK6Z78ZJRHNGQTAM4C",0,"MIT","https:\u002F\u002Fgithub.com\u002Ferwin-flores-ucb\u002Fproyecto-hoteles\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fswagger-typescript-api-es\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"typescript","swagger","es","swagger typescript api es","api","for","guide","config","node","run","generate","cli","when","auto","up","types","fetch","http client","axios","SET","2026-11-10 10:12:30",false,"---\nname: swagger-typescript-api-es\ndescription: Guide for using swagger-typescript-api-es — a CLI and Node.js tool that generates TypeScript API clients from Swagger\u002FOpenAPI schemas (ESM rewrite). Use when user asks to generate TypeScript API types from Swagger or OpenAPI, auto-generate axios or fetch HTTP client from swagger.json, set up swagger-typescript-api.config.ts, run gen-api-types script, or use swagger-typescript-api-es CLI.\nlicense: MIT\nmetadata:\n  author: hunghg255\n  version: 0.0.15\n  source: https:\u002F\u002Fgithub.com\u002Fhunghg255\u002Fswagger-typescript-api-es\n---\n\n# swagger-typescript-api-es\n\nESM + TypeScript rewrite of [swagger-typescript-api](https:\u002F\u002Fgithub.com\u002Facacode\u002Fswagger-typescript-api). Generates fully-typed TypeScript API clients (axios or fetch) from a Swagger 2.0 \u002F OpenAPI 3.0 schema URL or file.\n\n## Install\n\n```bash\nnpm i swagger-typescript-api-es@latest --save-dev\n# or\npnpm i swagger-typescript-api-es@latest -D\n```\n\n## Quick Start (One-off CLI)\n\nNo install needed — run directly with npx:\n\n```bash\nnpx swagger-typescript-api-es@latest -u https:\u002F\u002Fpetstore.swagger.io\u002Fv2\u002Fswagger.json -o .\u002Fsrc\u002Fapi\n```\n\n## Project Setup (Config File)\n\n### Step 1: Create `swagger-typescript-api.config.ts` at project root\n\n```ts\nimport { defaultConfig } from 'swagger-typescript-api-es';\n\nexport default defaultConfig({\n  name: 'api-axios.ts', \u002F\u002F output filename\n  output: '.\u002Fsrc\u002Fapis\u002Faxios-gentype', \u002F\u002F output directory\n  url: 'http:\u002F\u002Flocalhost:5002\u002Fapi-json', \u002F\u002F swagger schema URL\n  httpClientType: 'axios', \u002F\u002F 'axios' | 'fetch'\n});\n```\n\n### Step 2: Add script to `package.json`\n\n```json\n{\n  \"scripts\": {\n    \"gen-api-types\": \"swagger-typescript-api-es\"\n  }\n}\n```\n\n### Step 3: Run\n\n```bash\nnpm run gen-api-types\n# or\npnpm gen-api-types\n```\n\n## CLI Flags\n\n```bash\nnpx swagger-typescript-api-es@latest --help\n```\n\nKey flags:\n\n| Flag        | Description           |\n| ----------- | --------------------- |\n| `-u \u003Curl>`  | URL to swagger schema |\n| `-o \u003Cpath>` | Output directory      |\n| `-n \u003Cname>` | Output filename       |\n| `--axios`   | Use axios HTTP client |\n| `--fetch`   | Use fetch HTTP client |\n\n## Using a Local Schema File\n\nInstead of `url`, use `input` for a local file:\n\n```ts\nexport default defaultConfig({\n  name: 'api.ts',\n  output: '.\u002Fsrc\u002Fapi',\n  input: '.\u002Fswagger.json', \u002F\u002F local file path\n  httpClientType: 'fetch',\n});\n```\n\n## Gotchas\n\n- **Config filename must be exactly `swagger-typescript-api.config.ts`** (or `.js` \u002F `.mjs`) — the CLI looks for this name by default.\n- **`url` and `input` are mutually exclusive** — use `url` for remote schemas, `input` for local files. Providing both causes unpredictable behavior.\n- **`output` directory must exist or be creatable** — the tool does not create deeply nested paths automatically; ensure parent dirs exist.\n- **`cleanOutput: true` deletes everything in the output folder before generating** — do not point it at a folder that has hand-written files.\n- **`httpClientType` defaults to `fetch`** — explicitly set `'axios'` if your project uses axios, otherwise the generated client won't import it.\n- **`unwrapResponseData: true` changes the return shape** — with it, `api.getUser()` returns the data directly instead of the full axios response; set consistently across your codebase.\n- **`extractEnums: true` is needed for proper enum generation** — without it, enums are inlined as string literals in types.\n- **Swagger 2.0 vs OpenAPI 3.0** — both are supported but some options like `generateResponses` behave differently between versions. Test with your actual schema.\n\nSee `references\u002Foptions.md` for the full IOptions reference.\nSee `references\u002Fpatterns.md` for common usage patterns.\n","# swagger-typescript-api-es\n\nESM + TypeScript rewrite of [swagger-typescript-api](https:\u002F\u002Fgithub.com\u002Facacode\u002Fswagger-typescript-api). Generates fully-typed TypeScript API clients (axios or fetch) from a Swagger 2.0 \u002F OpenAPI 3.0 schema URL or file.\n\n## Install\n\n```bash\nnpm i swagger-typescript-api-es@latest --save-dev\n# or\npnpm i swagger-typescript-api-es@latest -D\n```\n\n## Quick Start (One-off CLI)\n\nNo install needed — run directly with npx:\n\n```bash\nnpx swagger-typescript-api-es@latest -u https:\u002F\u002Fpetstore.swagger.io\u002Fv2\u002Fswagger.json -o .\u002Fsrc\u002Fapi\n```\n\n## Project Setup (Config File)\n\n### Step 1: Create `swagger-typescript-api.config.ts` at project root\n\n```ts\nimport { defaultConfig } from 'swagger-typescript-api-es';\n\nexport default defaultConfig({\n  name: 'api-axios.ts', \u002F\u002F output filename\n  output: '.\u002Fsrc\u002Fapis\u002Faxios-gentype', \u002F\u002F output directory\n  url: 'http:\u002F\u002Flocalhost:5002\u002Fapi-json', \u002F\u002F swagger schema URL\n  httpClientType: 'axios', \u002F\u002F 'axios' | 'fetch'\n});\n```\n\n### Step 2: Add script to `package.json`\n\n```json\n{\n  \"scripts\": {\n    \"gen-api-types\": \"swagger-typescript-api-es\"\n  }\n}\n```\n\n### Step 3: Run\n\n```bash\nnpm run gen-api-types\n# or\npnpm gen-api-types\n```\n\n## CLI Flags\n\n```bash\nnpx swagger-typescript-api-es@latest --help\n```\n\nKey flags:\n\n| Flag        | Description           |\n| ----------- | --------------------- |\n| `-u \u003Curl>`  | URL to swagger schema |\n| `-o \u003Cpath>` | Output directory      |\n| `-n \u003Cname>` | Output filename       |\n| `--axios`   | Use axios HTTP client |\n| `--fetch`   | Use fetch HTTP client |\n\n## Using a Local Schema File\n\nInstead of `url`, use `input` for a local file:\n\n```ts\nexport default defaultConfig({\n  name: 'api.ts',\n  output: '.\u002Fsrc\u002Fapi',\n  input: '.\u002Fswagger.json', \u002F\u002F local file path\n  httpClientType: 'fetch',\n});\n```\n\n## Gotchas\n\n- **Config filename must be exactly `swagger-typescript-api.config.ts`** (or `.js` \u002F `.mjs`) — the CLI looks for this name by default.\n- **`url` and `input` are mutually exclusive** — use `url` for remote schemas, `input` for local files. Providing both causes unpredictable behavior.\n- **`output` directory must exist or be creatable** — the tool does not create deeply nested paths automatically; ensure parent dirs exist.\n- **`cleanOutput: true` deletes everything in the output folder before generating** — do not point it at a folder that has hand-written files.\n- **`httpClientType` defaults to `fetch`** — explicitly set `'axios'` if your project uses axios, otherwise the generated client won't import it.\n- **`unwrapResponseData: true` changes the return shape** — with it, `api.getUser()` returns the data directly instead of the full axios response; set consistently across your codebase.\n- **`extractEnums: true` is needed for proper enum generation** — without it, enums are inlined as string literals in types.\n- **Swagger 2.0 vs OpenAPI 3.0** — both are supported but some options like `generateResponses` behave differently between versions. Test with your actual schema.\n\nSee `references\u002Foptions.md` for the full IOptions reference.\nSee `references\u002Fpatterns.md` for common usage patterns.\n",{"name":5,"license":15,"metadata":54,"description":7},{"author":55,"source":56,"version":57},"hunghg255","https:\u002F\u002Fgithub.com\u002Fhunghg255\u002Fswagger-typescript-api-es","0.0.15","main","fdb08396233e7303407b2c2793e70e06adad5c98",".agents\u002Fskills\u002Fswagger-typescript-api-es",6,"https:\u002F\u002Fgithub.com\u002Ferwin-flores-ucb\u002Fproyecto-hoteles","https:\u002F\u002Fgithub.com\u002Ferwin-flores-ucb","2026-06-18 08:27:21",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add erwin-flores-ucb\u002Fproyecto-hoteles --skill swagger-typescript-api-es",{"tool":71,"command":72},"bunx","bunx skills add erwin-flores-ucb\u002Fproyecto-hoteles --skill swagger-typescript-api-es",{"tool":74,"command":75},"pnpm","pnpm dlx skills add erwin-flores-ucb\u002Fproyecto-hoteles --skill swagger-typescript-api-es","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ferwin-flores-ucb\u002Fproyecto-hoteles\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fswagger-typescript-api-es\u002FSKILL.md",true,[79,85],{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Foptions.md","REFERENCE","参考文档",4612,"https:\u002F\u002Fgithub.com\u002Ferwin-flores-ucb\u002Fproyecto-hoteles\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fswagger-typescript-api-es\u002Freferences\u002Foptions.md",{"path":86,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fpatterns.md",3143,"https:\u002F\u002Fgithub.com\u002Ferwin-flores-ucb\u002Fproyecto-hoteles\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fswagger-typescript-api-es\u002Freferences\u002Fpatterns.md",[]]