{"id":19462474,"url":"https://github.com/georgea93/jfuzz","last_synced_at":"2026-05-06T13:32:25.763Z","repository":{"id":56879074,"uuid":"144066155","full_name":"GeorgeA93/jfuzz","owner":"GeorgeA93","description":" Generate random data from your JSON schemas.","archived":false,"fork":false,"pushed_at":"2018-08-14T20:17:22.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T11:21:30.119Z","etag":null,"topics":["fuzzing","json","json-schema","testing"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/GeorgeA93.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-08T20:50:22.000Z","updated_at":"2022-02-15T16:45:01.000Z","dependencies_parsed_at":"2022-08-20T11:40:43.366Z","dependency_job_id":null,"html_url":"https://github.com/GeorgeA93/jfuzz","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/GeorgeA93%2Fjfuzz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgeA93%2Fjfuzz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgeA93%2Fjfuzz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgeA93%2Fjfuzz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeorgeA93","download_url":"https://codeload.github.com/GeorgeA93/jfuzz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240672819,"owners_count":19838929,"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":["fuzzing","json","json-schema","testing"],"created_at":"2024-11-10T18:01:33.121Z","updated_at":"2026-05-06T13:32:24.684Z","avatar_url":"https://github.com/GeorgeA93.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jfuzz\n\nGenerate random data from your JSON schemas.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'jfuzz'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install jfuzz\n\n## Usage\n\n```\nrequire \"jfuzz\"\n\nschema_path = \"path/to/your/json-schema\"\nJfuzz.fuzz(schema_path)\n```\n\n### Configuration\n\n#### Nil Probability\n\nThis determines how often we leave out optional fields. The default is `0.2` meaning we will leave out optional fields 20% of the time. It can be changed by:\n\n```\nJfuzz.set_nil_probability(0.5)\n```\n\n#### True Probability\n\nThis determines how likely a boolean type is to have a true value. The default is `0.5`\n\n```\nJfuzz.set_true_probability(0.5)\n```\n\n\n#### Min/Max Integer/Number values\n\nYou can change the min and max values of integers/numbers that are used when no minimums or maximums are supplied in your schema. The defaults are: -9999999 and 9999999.\n\n```\nJfuzz.set_min_integer(10)\nJfuzz.set_max_integer(100)\n```\n\n#### Min/Max Array Lengths\n\nYou can change the min and max length of arrays. These are used to generate a random length for an array when you do no specify a min or a max length in you schema. The defaults are 1 and 100\n\n```\nJfuzz.set_min_array_length(10)\nJfuzz.set_max_array_length(100)\n```\n\n### Generators\n\nIf you want custom behaviour when fuzzing a particular type, you can change our built in default generators. This is also useful if you want to add support for your own custom type. First you must define a generator class, e.g. lets say we want to do our own string generation logic:\n\n```ruby\nrequire \"jfuzz/generators/generator\"\n\nclass BetterStringGenerator \u003c Jfuzz::Generator\n    def generate\n        \"AMAZING STRING\"\n    end\n\n    def self.type\n      \"string\"\n    end\nend\n```\n\nFinally you need to register the generator with JFuzz by doing the following:\n\n```ruby\nJfuzz.register_generator(BetterStringGenerator)\n```\n\nNote. You will need to register your new generator before calling `Jfuzz.fuzz`\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/georgea93/jfuzz.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgea93%2Fjfuzz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgea93%2Fjfuzz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgea93%2Fjfuzz/lists"}