{"id":20394025,"url":"https://github.com/vvenv/vscode-restman","last_synced_at":"2026-06-01T03:31:28.225Z","repository":{"id":51897232,"uuid":"320641941","full_name":"vvenv/vscode-restman","owner":"vvenv","description":"VS Code extension that invoke requests in the REST files.","archived":false,"fork":false,"pushed_at":"2021-05-09T05:45:55.000Z","size":343,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-23T12:07:35.950Z","etag":null,"topics":["dotenv","json-schema","json-schema-faker","json-schema-validator","mock-server","restful"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=crossjs.vscode-restman","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/vvenv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-12-11T17:37:06.000Z","updated_at":"2021-05-09T05:44:47.000Z","dependencies_parsed_at":"2022-08-23T07:50:34.938Z","dependency_job_id":null,"html_url":"https://github.com/vvenv/vscode-restman","commit_stats":null,"previous_names":["l-w-f/vscode-restman","vvenv/vscode-restman","crossjs/vscode-restman"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vvenv/vscode-restman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvenv%2Fvscode-restman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvenv%2Fvscode-restman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvenv%2Fvscode-restman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvenv%2Fvscode-restman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vvenv","download_url":"https://codeload.github.com/vvenv/vscode-restman/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvenv%2Fvscode-restman/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33657690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"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":["dotenv","json-schema","json-schema-faker","json-schema-validator","mock-server","restful"],"created_at":"2024-11-15T03:51:36.080Z","updated_at":"2026-06-01T03:31:28.203Z","avatar_url":"https://github.com/vvenv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![image](./restman.png)\n\n[![Node CI](https://github.com/crossjs/vscode-restman/workflows/Node%20CI/badge.svg?event=push)](https://github.com/crossjs/vscode-restman/actions?query=workflow%3A%22Node+CI%22)\n[![Marketplace Version](https://vsmarketplacebadge.apphb.com/version-short/crossjs.vscode-restman.svg)](https://marketplace.visualstudio.com/items?itemName=crossjs.vscode-restman)\n[![Downloads](https://vsmarketplacebadge.apphb.com/downloads/crossjs.vscode-restman.svg)](https://marketplace.visualstudio.com/items?itemName=crossjs.vscode-restman)\n[![Installs](https://vsmarketplacebadge.apphb.com/installs/crossjs.vscode-restman.svg)](https://marketplace.visualstudio.com/items?itemName=crossjs.vscode-restman)\n[![Rating](https://vsmarketplacebadge.apphb.com/rating/crossjs.vscode-restman.svg)](https://marketplace.visualstudio.com/items?itemName=crossjs.vscode-restman)\n\n# RESTMAN\n\n一个可以执行与模拟 RESTful 请求的 VS Code 插件。\n\n## 示例\n\n新建一条 TODO 信息\n\n    ### [POST] /api/todos\n\n    ```json.req\n    {\n      \"type\": \"object\",\n      \"properties\": {\n        \"data\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"content\": {\n              \"type\": \"string\",\n              \"maxLength\": 500\n            }\n          },\n          \"required\": [\"content\"]\n        }\n      },\n      \"required\": [\"data\"]\n    }\n    ```\n\n## 功能\n\n### 接口定义\n\n建议声明 [RESTful][1] 风格的接口，充分利用 `GET`、`POST`、`PUT`、`PATCH`、`DELETE` 等请求方法，尽量保证接口的简洁明了。\n\n除了定义方法与地址外，还可以使用 [JSON Schema][2] 定义请求与响应的格式。\n\n#### 方法\n\n`GET` | `POST` | `PUT` | `DELETE` | `PATCH` | `HEAD` | `OPTIONS` | `CONNECT` | `TRACE`\n\n#### 地址\n\n以 `/` 开头，不允许空格，比如 `/api/whoami`。\n\n#### 请求消息\n\n允许使用 JSON Schema 定义请求消息头（headers）与请求消息体（data）。\n\n#### 响应消息\n\n允许使用 JSON Schema 定义响应状态（status）、响应消息头（headers）与响应消息体（data）。\n\n### 接口模拟\n\n根据接口定义中 `json.res` 块的 Schema，结合 [JSON Schema Faker][3] 自动响应符合规范的消息。\n\n⚠️ 启用此功能时，如果环境变量 `ORIGIN` 中定义的端口（未定义则使用 `3000`）被占用，则会报错。\n\n### 变量替换\n\n可以使用 `{{@?[\\w._]+}}` 声明接口中的变量，如 `{{ID}}`，接口应用时会自动替换为环境变量（dotenv）或用户输入，其中以 `@` 开头的变量将替换为文件选择。\n\n#### 环境变量\n\n读取 workspace 中的 [dotenv](#dotenvFiles) 变量，用于定义请求信息中的变量，其中 `ORIGIN` 变量用于生成默认 `baseURL` 与启动模拟服务器。\n\n#### 用户输入\n\n发起请求前，通过编辑器的选择框、输入框、文件选择框等界面，定义未在 dotenv 中找到的变量。\n\n### 伪数据\n\n点击 Schema 块上方的 `Faker` 链接，可以生成伪数据，参见 [JSON Schema Faker][3]。\n\n### 检查与格式化\n\n#### 检查\n\n自动检查 Schema 是否合法，并给出提示。\n\n#### 格式化\n\n点击 Schema 块上方的 `Format` 链接，可以格式化 JSON Schema。\n\n### 文档\n\n基于文档模板，可以预览与生成 Markdown 格式、对非接口开发人员友好、适用于对外发布的接口文档。\n\n#### 预览\n\n点击 .rest 文件标题栏右侧的 Doc 按钮，可以预览生成的 Markdown 文档。\n\n#### 生成\n\n在命令面板中执行 `RESTMAN: Generate` 可以生成当前 Workspace 下所有 .rest 文件对应的 Markdown 文档。\n\n\n### 格式转化\n\n🚧 与 Swagger、Postman、YAPI 等接口管理工具互转\n\n## 配置项\n\n### enable\n\n默认值：`true`\n\n是否启用插件\n\n### mockServer\n\n默认值：`false`\n\n是否启用模拟服务器\n### dotenvFiles\n\n默认值：`**/.{env,env.local,env.development.local}`\n\n匹配当前 workspace 下 dotenv 文件\n\n## 相关依赖\n\n- [ajv](https://ajv.js.org/)\n- [axios](https://github.com/axios/axios)\n- [dotenv](https://github.com/motdotla/dotenv)\n- [form-data](https://github.com/form-data/form-data)\n- [formidable](https://github.com/node-formidable/formidable)\n- [json-schema-faker][3]\n- [lodash](https://lodash.com/)\n- [micromatch](https://github.com/micromatch/micromatch)\n- [tough-cookie](https://github.com/salesforce/tough-cookie)\n\n[1]: https://zh.wikipedia.org/wiki/表现层状态转换\n[2]: https://json-schema.org/\n[3]: https://json-schema.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvvenv%2Fvscode-restman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvvenv%2Fvscode-restman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvvenv%2Fvscode-restman/lists"}