{"id":15639836,"url":"https://github.com/fredx87/openapi-mock-generator","last_synced_at":"2025-04-14T16:09:26.513Z","repository":{"id":38173177,"uuid":"232924653","full_name":"Fredx87/openapi-mock-generator","owner":"Fredx87","description":"Progressive Web App for generating mocked data from an OpenAPI specification","archived":false,"fork":false,"pushed_at":"2023-01-05T13:58:02.000Z","size":8845,"stargazers_count":84,"open_issues_count":16,"forks_count":4,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-03-28T04:51:12.144Z","etag":null,"topics":["generator","mock","oas3","openapi","swagger"],"latest_commit_sha":null,"homepage":"https://fredx87.github.io/openapi-mock-generator","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fredx87.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-09T23:15:43.000Z","updated_at":"2024-05-23T21:31:25.000Z","dependencies_parsed_at":"2022-08-08T23:16:10.040Z","dependency_job_id":null,"html_url":"https://github.com/Fredx87/openapi-mock-generator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fredx87%2Fopenapi-mock-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fredx87%2Fopenapi-mock-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fredx87%2Fopenapi-mock-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fredx87%2Fopenapi-mock-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fredx87","download_url":"https://codeload.github.com/Fredx87/openapi-mock-generator/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246273533,"owners_count":20750904,"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":["generator","mock","oas3","openapi","swagger"],"created_at":"2024-10-03T11:27:43.058Z","updated_at":"2025-03-30T03:31:22.847Z","avatar_url":"https://github.com/Fredx87.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# OpenAPI Mock Generator\n\nCreate realistic mocked data from an OpenAPI specification, using [faker.js](https://github.com/marak/Faker.js/) and [Chance](https://chancejs.com/) random data generators.\n\n[![GitHub Workflow Status][build-shield]][build]\n[![Cypress.io tests][cypress-shield]][cypress]\n[![Codecov][coverage-shield]][coverage]\n![GitHub release (latest SemVer)][version-shield]\n![License][license-shield]\n\n[Go to app](https://fredx87.github.io/openapi-mock-generator/)\n\n![](demo.gif)\n\n\u003c/div\u003e\n\n## Features\n\n- Support for OpenAPI 3.0 (and 2.0 with conversion to 3.0)\n- Generate realistic mocks for paths/schemas using JSON Schema properties (like `format`. `minimum`, `maximum`, etc...), [faker.js](https://github.com/marak/Faker.js/) or [Chance](https://chancejs.com/) data generators.\n- Autocomplete for OpenAPI properties, Faker.js methods, and Chance methods\n- Multiple projects support with data stored locally in the browser\n- Offline support\n\n## Usage\n\nOnce you have loaded an OpenApi specification, you can navigate the tree with paths and schemas, and load a definition in the editor. You can modify the selected definition and see the generated mocked data in the editor on the right. The modified definition will be taken also by other elements that have a reference to that definition.\n\nIn the tree, there is also a special `Playground` item that can be used to generate data \"on the fly\" without modifying an existing definition.\n\n### JSON Schema properties examples\n\nData can be generated from the `format` property:\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"date\": {\n      \"type\": \"string\",\n      \"format\": \"date-time\"\n    },\n    \"uuid\": {\n      \"type\": \"string\",\n      \"format\": \"uuid\"\n    }\n  }\n}\n```\n\n```json\n{\n  \"date\": \"1986-09-22T16:44:15.119Z\",\n  \"uuid\": \"daf0229f-cc3b-2b50-bbe4-6dea4837b0bf\"\n}\n```\n\nNumber ranges can be controlled with `minimum` and `maximum`:\n\n```json\n{\n  \"type\": \"integer\",\n  \"minimum\": 10,\n  \"maximum\": 42\n}\n```\n\n```json\n21\n```\n\nArray items length can be controlled with `minItems` and `maxItems`:\n\n```json\n{\n  \"type\": \"array\",\n  \"minItems\": 5,\n  \"maxItems\": 10,\n  \"items\": {\n    \"type\": \"number\"\n  }\n}\n```\n\n```json\n[\n  71856238.93752578,\n  -9957501.746244192,\n  -7145041.207682312,\n  -53358509.39871331,\n  -83770088.68054512,\n  -25448017.578881666,\n  45764879.26211512,\n  -5112859.453620076,\n  -74878171.17192386,\n  46948099.995764345\n]\n```\n\n### Faker.js and Chance methods\n\nYou can use the name of a `faker.js` or `Chance` method using the `x-faker` or `x-chance` properties:\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"name\": {\n      \"type\": \"string\",\n      \"x-chance\": \"company\"\n    },\n    \"description\": {\n      \"type\": \"string\",\n      \"x-faker\": \"company.catchPhrase\"\n    }\n  }\n}\n```\n\n```json\n{\n  \"name\": \"Citigroup, Inc\",\n  \"description\": \"Vision-oriented foreground middleware\"\n}\n```\n\nYou can pass parameters to the method using an object with the method name as a key and an array of values as parameters:\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"date\": {\n      \"type\": \"string\",\n      \"format\": \"date\",\n      \"x-faker\": {\n        \"date.between\": [\"2000\", \"2050\"]\n      }\n    }\n  }\n}\n```\n\n```json\n{\n  \"date\": \"2040-05-06\"\n}\n```\n\nYou can pass also object as a single parameter:\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"email\": {\n      \"type\": \"string\",\n      \"format\": \"email\",\n      \"x-chance\": {\n        \"email\": {\n          \"domain\": \"acme.com\"\n        }\n      }\n    }\n  }\n}\n```\n\n```json\n{\n  \"email\": \"aci@acme.com\"\n}\n```\n\nFor Faker.js, you can interpolate multiple results with the `fake` method:\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"name\": {\n      \"type\": \"string\",\n      \"x-faker\": {\n        \"fake\": [\"{{name.lastName}}, {{name.firstName}} {{name.suffix}}\"]\n      }\n    }\n  }\n}\n```\n\n```json\n{\n  \"name\": \"Schmeler, Odie Jr.\"\n}\n```\n\nThe code generation is based on [json-schema-faker](https://github.com/json-schema-faker/json-schema-faker), you can also check the [project documentation](https://github.com/json-schema-faker/json-schema-faker/blob/master/docs/USAGE.md) for other examples.\n\n## License\n\nMIT\n\n[build]: https://github.com/Fredx87/openapi-mock-generator/actions?query=workflow%3A%22Build+and+test%22\n[build-shield]: https://img.shields.io/github/workflow/status/Fredx87/openapi-mock-generator/Build%20and%20test\n[coverage]: https://codecov.io/gh/Fredx87/openapi-mock-generator\n[coverage-shield]: https://img.shields.io/codecov/c/github/Fredx87/openapi-mock-generator\n[version-shield]: https://img.shields.io/github/v/release/Fredx87/openapi-mock-generator\n[license-shield]: https://img.shields.io/github/license/Fredx87/openapi-mock-generator\n[cypress]: https://dashboard.cypress.io/projects/ebmx24/runs\n[cypress-shield]: https://img.shields.io/badge/cypress.io-tests-green.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredx87%2Fopenapi-mock-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffredx87%2Fopenapi-mock-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredx87%2Fopenapi-mock-generator/lists"}