{"id":20937156,"url":"https://github.com/danibram/mocker-api-tester","last_synced_at":"2025-05-13T22:31:03.938Z","repository":{"id":49313250,"uuid":"52058210","full_name":"danibram/mocker-api-tester","owner":"danibram","description":"mocker-data-generator for test","archived":false,"fork":false,"pushed_at":"2018-03-20T03:27:54.000Z","size":14,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-15T06:25:23.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/danibram.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}},"created_at":"2016-02-19T03:20:40.000Z","updated_at":"2023-02-24T16:03:11.000Z","dependencies_parsed_at":"2022-08-30T03:50:40.254Z","dependency_job_id":null,"html_url":"https://github.com/danibram/mocker-api-tester","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danibram%2Fmocker-api-tester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danibram%2Fmocker-api-tester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danibram%2Fmocker-api-tester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danibram%2Fmocker-api-tester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danibram","download_url":"https://codeload.github.com/danibram/mocker-api-tester/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225260833,"owners_count":17446115,"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":[],"created_at":"2024-11-18T22:33:24.511Z","updated_at":"2024-11-18T22:33:25.421Z","avatar_url":"https://github.com/danibram.png","language":"JavaScript","funding_links":["https://www.paypal.me/danibram"],"categories":[],"sub_categories":[],"readme":"# mocker-api-tester\n\n[![Support link][paypal-badge]][paypal-link]\n\nmocker-tester is the repository of the api deployed in heroku of this awesome module:\n\n[https://github.com/danibram/mocker-data-generator](https://github.com/danibram/mocker-data-generator)\n\nThis project lives in heroku: [https://mocker-api.herokuapp.com](https://github.com/danibram/mocker-data-generator)\n##API\n####2 routes are exposed:\n- **_/schema/:name_** (POST): You must pass in the body a JSON with this structure:\n\n  ```javascript\n    //Structure\n    {schema, options}\n\n    //Example\n    {\n        \"schema\": {\n            \"firstName\": {\n                \"faker\": \"name.firstName\"\n            },\n            \"lastName\": {\n                \"faker\": \"name.lastName\"\n            },\n            \"country\": {\n                \"faker\": \"address.country\"\n            },\n            \"createdAt\": {\n                \"faker\": \"date.past\"\n            }\n        },\n        \"options\": 5\n    }\n\n    //Response\n    {\n      \"metadata\": {\n        \"count\": 5,\n        \"generationTime(seconds)\": 0.001\n      },\n      \"users\": [\n        {\n          \"firstName\": \"Ignatius\",\n          \"lastName\": \"Shields\",\n          \"country\": \"Georgia\",\n          \"createdAt\": \"2015-04-21T14:26:28.920Z\"\n        },\n        {\n          \"firstName\": \"Braxton\",\n          \"lastName\": \"Heathcote\",\n          \"country\": \"Sri Lanka\",\n          \"createdAt\": \"2015-03-16T19:04:37.245Z\"\n        },\n        {\n          \"firstName\": \"Marlin\",\n          \"lastName\": \"Morar\",\n          \"country\": \"Kuwait\",\n          \"createdAt\": \"2015-12-03T04:53:37.689Z\"\n        },\n        {\n          \"firstName\": \"Emmanuel\",\n          \"lastName\": \"Bernhard\",\n          \"country\": \"Togo\",\n          \"createdAt\": \"2015-08-25T14:40:59.559Z\"\n        },\n        {\n          \"firstName\": \"Hermina\",\n          \"lastName\": \"Heathcote\",\n          \"country\": \"Marshall Islands\",\n          \"createdAt\": \"2015-09-19T07:24:54.477Z\"\n        }\n      ]\n    }\n  ```\n\n- **_/schemas_** (POST):  You must pass in the body a JSON with this structure:\n\n  ```javascript\n    //Structure\n    [{name, schema, options}, {name, schema, options}, {name, schema, options}, ...]\n\n    //Example\n        [{\n          \"name\": \"users\",\n          \"schema\": {\n              \"firstName\": {\n                  \"faker\": \"name.firstName\"\n              },\n              \"lastName\": {\n                  \"faker\": \"name.lastName\"\n              },\n              \"country\": {\n                  \"faker\": \"address.country\"\n              },\n              \"createdAt\": {\n                  \"faker\": \"date.past\"\n              }\n          },\n          \"options\": 5\n      },{\n          \"name\": \"cats\",\n          \"schema\": {\n              \"name\":{\n                  \"values\": [\"pitxi\", \"txury\", \"kitty\"]\n              }\n          },\n          \"options\": 4\n      }]\n\n      //Response\n      {\n      \"users\": [\n        {\n          \"firstName\": \"Ila\",\n          \"lastName\": \"Hackett\",\n          \"country\": \"Morocco\",\n          \"createdAt\": \"2015-04-18T05:37:56.118Z\"\n        },\n        {\n          \"firstName\": \"Breana\",\n          \"lastName\": \"Larkin\",\n          \"country\": \"Haiti\",\n          \"createdAt\": \"2015-10-30T17:50:09.801Z\"\n        },\n        {\n          \"firstName\": \"Rory\",\n          \"lastName\": \"Hilpert\",\n          \"country\": \"Togo\",\n          \"createdAt\": \"2015-04-30T08:40:01.859Z\"\n        },\n        {\n          \"firstName\": \"Dawn\",\n          \"lastName\": \"McClure\",\n          \"country\": \"Kiribati\",\n          \"createdAt\": \"2015-11-28T01:23:42.825Z\"\n        },\n        {\n          \"firstName\": \"Rosemarie\",\n          \"lastName\": \"Huels\",\n          \"country\": \"Uzbekistan\",\n          \"createdAt\": \"2015-12-15T09:36:49.934Z\"\n        }\n      ],\n      \"cats\": [\n        {\n          \"name\": \"txury\"\n        },\n        {\n          \"name\": \"kitty\"\n        },\n        {\n          \"name\": \"kitty\"\n        },\n        {\n          \"name\": \"txury\"\n        }\n      ],\n      \"metadata\": {\n        \"generationTime(seconds)\": 0.002\n      }\n      }\n  ```\n##Curl Examples:\n\n[![asciicast](https://asciinema.org/a/36797.png)](https://asciinema.org/a/36797)\n\n- **_/schema/:name_**\n\n  ```bash\n  curl -i \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type:application/json\" \\\n  -X POST --data '{ \"schema\": { \"firstName\": { \"faker\": \"name.firstName\" }, \"lastName\": { \"faker\": \"name.lastName\" }, \"country\": { \"faker\": \"address.country\" }, \"createdAt\": { \"faker\": \"date.past\" } }, \"options\": 5 }' https://mocker-api.herokuapp.com/schema/users\n  ```\n\n  ```bash\n  curl -i \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type:application/json\" \\\n  -X POST --data '{ \"schema\": { \"firstName\": { \"faker\": \"name.firstName\" }, \"lastName\": { \"faker\": \"name.lastName\" }}, \"options\": 5 }' https://mocker-api.herokuapp.com/schema/users\n  ```\n\n- **_/schemas**\n\n  ```bash\n  curl -i \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type:application/json\" \\\n  -X POST --data '[{ \"name\": \"users\", \"schema\": { \"firstName\": { \"faker\": \"name.firstName\" }, \"lastName\": { \"faker\": \"name.lastName\" }, \"country\": { \"faker\": \"address.country\" }, \"createdAt\": { \"faker\": \"date.past\" } }, \"options\": 5 },{ \"name\": \"cats\", \"schema\": { \"name\":{ \"values\": [\"pitxi\", \"txury\", \"kitty\"] } }, \"options\": 4 }]' https://mocker-api.herokuapp.com/schemas\n  ```\n\n## Module Documentation\n[https://github.com/danibram/mocker-data-generator](https://github.com/danibram/mocker-data-generator)\n\n## License\nLicensed under the MIT license. 2015\n\n[paypal-badge]: https://img.shields.io/badge/❤%20support-paypal-blue.svg?style=flat-square\n[paypal-link]: https://www.paypal.me/danibram\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanibram%2Fmocker-api-tester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanibram%2Fmocker-api-tester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanibram%2Fmocker-api-tester/lists"}