{"id":13624014,"url":"https://github.com/bebraw/schema2object","last_synced_at":"2025-10-01T07:31:19.699Z","repository":{"id":25750462,"uuid":"29188370","full_name":"bebraw/schema2object","owner":"bebraw","description":"Generate random objects based on JSON Schema (MIT)","archived":false,"fork":false,"pushed_at":"2015-01-20T14:49:25.000Z","size":180,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-26T20:49:58.359Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/schema2object","language":"JavaScript","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/bebraw.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":"2015-01-13T12:13:38.000Z","updated_at":"2017-01-23T13:55:54.000Z","dependencies_parsed_at":"2022-08-28T18:20:12.611Z","dependency_job_id":null,"html_url":"https://github.com/bebraw/schema2object","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/bebraw%2Fschema2object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bebraw%2Fschema2object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bebraw%2Fschema2object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bebraw%2Fschema2object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bebraw","download_url":"https://codeload.github.com/bebraw/schema2object/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234841962,"owners_count":18895141,"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-08-01T21:01:37.853Z","updated_at":"2025-10-01T07:31:14.444Z","avatar_url":"https://github.com/bebraw.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![build status](https://secure.travis-ci.org/bebraw/schema2object.png)](http://travis-ci.org/bebraw/schema2object)\n# schema2object - Generate random objects based on JSON Schema\n\nUsage:\n\n```javascript\n// it is possible to replace generators with something else\n// just implement {\u003cjson schema property\u003e -\u003e fn} where fn should return\n// a generated value\nvar generators = require('annogenerate');\n\nvar schema2object = require('schema2object');\nvar definitions = ...; // Object of JSON schemas (name -\u003e schema)\nvar definition = ...; // JSON Schema\n\n\nvar properties = definition.properties;\n\n// if you want, you can generate data only for required fields\nif(definition.required) {\n    properties = schema2object.getRequiredProperties(definition);\n}\n\nvar o = schema2object.properties2object({\n    generators: generators,\n    // fieldGenerators - optional generators that match per field name\n    properties: properties,\n    definitions: definitions // optional definitions for checking against $ref\n});\n\n// you should have an object with random data now\nconsole.log(o);\n```\n\nSee `/demo` for a more comprehensive example.\n\n## License\n\n`schema2object` is available under MIT. See LICENSE for more details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbebraw%2Fschema2object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbebraw%2Fschema2object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbebraw%2Fschema2object/lists"}