{"id":22098472,"url":"https://github.com/reeli/swagger-faker","last_synced_at":"2025-07-24T22:33:37.763Z","repository":{"id":45105393,"uuid":"198747672","full_name":"reeli/swagger-faker","owner":"reeli","description":"Generate mocker services automatically through Swagger or OpenAPI.","archived":false,"fork":false,"pushed_at":"2023-05-23T08:41:20.000Z","size":972,"stargazers_count":45,"open_issues_count":0,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-29T15:52:37.288Z","etag":null,"topics":["faker","mock-data-generator","swager","swagger-faker"],"latest_commit_sha":null,"homepage":"https://reeli.github.io/swagger-faker/","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/reeli.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,"publiccode":null,"codemeta":null}},"created_at":"2019-07-25T03:10:35.000Z","updated_at":"2024-06-06T09:38:31.000Z","dependencies_parsed_at":"2024-06-21T15:34:38.000Z","dependency_job_id":"d152798c-8b67-4c83-97c0-7c912883776a","html_url":"https://github.com/reeli/swagger-faker","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reeli%2Fswagger-faker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reeli%2Fswagger-faker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reeli%2Fswagger-faker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reeli%2Fswagger-faker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reeli","download_url":"https://codeload.github.com/reeli/swagger-faker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227482670,"owners_count":17780032,"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","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":["faker","mock-data-generator","swager","swagger-faker"],"created_at":"2024-12-01T04:20:01.530Z","updated_at":"2024-12-01T04:20:02.122Z","avatar_url":"https://github.com/reeli.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swagger Faker\n\n![Build Status](https://github.com/reeli/swagger-faker/actions/workflows/deploy.yml/badge.svg)\n[![codecov](https://codecov.io/gh/reeli/swagger-faker/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/reeli/swagger-faker)\n[![License](https://img.shields.io/npm/l/swagger-faker.svg?style=flat-square)](https://npmjs.org/package/@ts-tool/swagger-faker)\n[![NPM](https://img.shields.io/npm/v/swagger-faker.svg?style=flat-square)](https://npmjs.org/package/@ts-tool/swagger-faker)\n\nSwagger Faker is a tool which can help you generate fake data from your swagger.json file, then it will start a mock server automatically with the generated fake data.\n\n## How to Use\n\n1. Install\n\n```shell\nnpm i swagger-faker -g\n```\n\n2. Init config file by command:\n\n```shell\nswagger-faker init\n```\n\nThen it will generate a config file `swagger-faker.config.json` in current path, update that config file:\n\n```json\n{\n  \"sourcePaths\": [\"./source/openapi.json\"],\n  \"outputFolder\": \"mock-server\",\n  \"timeout\": 180000,\n  \"port\": 8081\n}\n```\n\n- **sourcePaths**: `required`, put your swagger/openapi file path here. Either local path(eg. \"./source/openapi.json\") or remote path(eg. https://petstore.swagger.io/v2/swagger.json) is supported. Valid format: json, yaml, yml.\n- **outputFolder**: `optional`\n- **timeout**: `optional`,\n- **port**: `optional`\n\n3. Generate fake data\n\n```shell\nswagger-faker gen\n```\n\n4. Start the mock server\n\n```shell\nswagger-faker run\n```\n\n## Examples\n\n```shell\ngit clone https://github.com/reeli/swagger-faker-examples.git\ncd  swagger-faker-examples\nnpm install\nnpm start\n```\n\nThen you'll see:\n\n1. A `mock-server` folder has been generated in your current path, and all mock data is setting in `mock-server/data` folder, you can customize them if needed.\n2. A mock server has been started in `http://localhost:8081`, you can open your browser and visit one of the mock API by `http://localhost:8081/api/v2/store/order/1` (The mock data is setting in: `mock-server/data/getOrderById.json`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freeli%2Fswagger-faker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freeli%2Fswagger-faker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freeli%2Fswagger-faker/lists"}