{"id":16808881,"url":"https://github.com/timakin/json_schema_power_validator","last_synced_at":"2025-04-11T01:20:41.215Z","repository":{"id":35188446,"uuid":"39446456","full_name":"timakin/json_schema_power_validator","owner":"timakin","description":"Test JSON Schema itself","archived":false,"fork":false,"pushed_at":"2015-07-26T04:32:47.000Z","size":202,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T22:17:17.822Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"sepehrdaddev/Xerxes","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timakin.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":"2015-07-21T13:20:01.000Z","updated_at":"2015-08-05T10:45:58.000Z","dependencies_parsed_at":"2022-09-15T11:21:53.511Z","dependency_job_id":null,"html_url":"https://github.com/timakin/json_schema_power_validator","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timakin%2Fjson_schema_power_validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timakin%2Fjson_schema_power_validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timakin%2Fjson_schema_power_validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timakin%2Fjson_schema_power_validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timakin","download_url":"https://codeload.github.com/timakin/json_schema_power_validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248323149,"owners_count":21084452,"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-10-13T10:00:15.288Z","updated_at":"2025-04-11T01:20:41.199Z","avatar_url":"https://github.com/timakin.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JsonSchema::PowerValidator\n\nTest JSON Schema itself with contexts.\nAfter preparation of schema and test suite, you can test schema response.\nIt'll display each results with json format.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'json_schema_power_validator'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install json_schema_power_validator\n\n## Usage\n\nPrepare json schema you'd like to test and test suite.\nA test suite must be written on the fixed format.\nThe suite must include parameters:\n\n- examples \t\t\t- Array of test cases, and each of them should include following parameters\n\t- context \t\t- Title of each test\n\t- description - Detail of the test\n\t- expect\t\t\t- Expectation of a result of test (it must be \"valid\"/\"invalid\")\n\t- values \t\t\t- Parameters that'll be used as test values.\n\nThe below json is the example of test suite on the above format.\n\n```json\n{\n\t\"examples\": [\n\t\t{\n\t\t\t\"context\": \"Success\",\n\t\t\t\"description\": \"Success Case\",\n\t\t\t\"expect\": \"valid\",\n\t\t\t\"values\": {\n\t\t\t\t  \"id\": 1234,\n\t\t\t\t  \"name\": \"timakin\",\n\t\t\t\t  ...\n\t\t\t}\n\t\t},\n\t\t{ ... },\n\t\t{ ... }\n\t]\n}\n```\n\nWith the suite, you can get a detail error message, and check whether the results are all clear or not.\n\n```ruby\nrequire 'json_schema_power_validator'\n\nvalidated_schema = JsonSchema::PowerValidator.new(\"schema/sample.json\", \"schema/suite/sample.json\")\nvalidated_schema.get_result\n#{\n#\t\"results\": [\n#\t\t{\n#\t\t\t\"context\": \"Success\",\n#\t\t\t\"description\": \"Success Case\",\n#\t\t\t\"result\": \"success\"\n#\t\t},\n#\t\t{ ... },\n#\t\t{\n#\t\t\t\"context\": \"Fail\",\n#\t\t\t\"description\": \"Failed Case\",\n#\t\t\t\"result\": \"The property '#/id' did not have a minimum value of 0, inclusively\"\n#\t\t}\n#\t]\n#}\n\nvalidated_schema.ok?\n# false\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, 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` to 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## Test\n\nTo run test:\n\n```\n$ cd /path/to/repository\n$ bundle install --path vendor/bundle\n$ bundle exec ruby spec/json_schema_power_validator_spec.rb\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/timakin/json_schema_power_validator/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimakin%2Fjson_schema_power_validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimakin%2Fjson_schema_power_validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimakin%2Fjson_schema_power_validator/lists"}