{"id":20677823,"url":"https://github.com/clivern/decoy","last_synced_at":"2025-03-10T19:22:50.048Z","repository":{"id":42858775,"uuid":"210131055","full_name":"Clivern/Decoy","owner":"Clivern","description":"🔥 JSON Schema Validation Package for Java.","archived":false,"fork":false,"pushed_at":"2025-01-31T02:54:11.000Z","size":475,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-02T12:17:18.310Z","etag":null,"topics":["api-validator","java","java-validation-framework","json-schema","json-schema-validator","schema-validation","schema-validator"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Clivern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"clivern"}},"created_at":"2019-09-22T10:47:35.000Z","updated_at":"2021-12-06T19:19:48.000Z","dependencies_parsed_at":"2024-03-03T19:35:20.265Z","dependency_job_id":"7931b0e3-b9f5-4dba-8c26-0673e11c9bcc","html_url":"https://github.com/Clivern/Decoy","commit_stats":null,"previous_names":["clivern/kangaroo"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clivern%2FDecoy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clivern%2FDecoy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clivern%2FDecoy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clivern%2FDecoy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Clivern","download_url":"https://codeload.github.com/Clivern/Decoy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242910284,"owners_count":20205261,"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":["api-validator","java","java-validation-framework","json-schema","json-schema-validator","schema-validation","schema-validator"],"created_at":"2024-11-16T21:17:13.137Z","updated_at":"2025-03-10T19:22:50.023Z","avatar_url":"https://github.com/Clivern.png","language":"Java","funding_links":["https://github.com/sponsors/clivern"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\u003cimg alt=\"Decoy Logo\" src=\"https://raw.githubusercontent.com/Clivern/Decoy/master/images/logo.png\" height=\"150\" /\u003e\n\t\u003ch3 align=\"center\"\u003eDecoy\u003c/h3\u003e\n\t\u003cp align=\"center\"\u003eJSON Schema Validation Package for Java.\u003c/p\u003e\n\t\u003cp align=\"center\"\u003e\n        \u003ca href=\"https://github.com/clivern/decoy/actions/workflows/ci.yml\"\u003e\n            \u003cimg src=\"https://github.com/clivern/decoy/actions/workflows/ci.yml/badge.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"http://www.javadoc.io/doc/com.clivern/decoy\"\u003e\n            \u003cimg src=\"http://www.javadoc.io/badge/com.clivern/decoy.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://mvnrepository.com/artifact/com.clivern/decoy/0.1.0\"\u003e\n            \u003cimg src=\"https://img.shields.io/maven-central/v/com.clivern/decoy.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/clivern/decoy/blob/main/LICENSE\"\u003e\n            \u003cimg src=\"https://img.shields.io/badge/LICENSE-Apache_2.0-orange.svg\"\u003e\n        \u003c/a\u003e\n\t\u003c/p\u003e\n\u003c/p\u003e\n\nDecoy is a Java implementation for the [JSON Schema Standard](https://json-schema.org/) (`draft-03`, `draft-04`, `draft-06` and `draft-07`), that will help you validate all sorts of JSON documents, whether they are configuration files or a set of data sent to a RESTful API endpoint.\n\n\n## Documentation\n\n### Installation\n\nTo add a dependency using Maven, use the following:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.clivern\u003c/groupId\u003e\n    \u003cartifactId\u003edecoy\u003c/artifactId\u003e\n    \u003cversion\u003e0.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nTo add a dependency using Gradle, use the following:\n\n```java\ndependencies {\n    compile 'com.clivern:decoy:0.1.0'\n}\n```\n\nTo add a dependency using Scala SBT, use the following:\n\n```java\nlibraryDependencies += \"com.clivern\" % \"decoy\" % \"0.1.0\"\n```\n\n\n### Usage\n\nFirst import \u0026 initialize all required classes.\n\n```java\nimport com.clivern.decoy.util.FileReader;\nimport com.clivern.decoy.SchemaFactory;\nimport com.clivern.decoy.Validator;\n\n\nFileReader fileReader = new FileReader();\nSchemaFactory schemaFactory = new SchemaFactory();\nValidator validator = new Validator();\n```\n\nThen validate the `JSON` string against the `JSON Schema`.\n\n```java\nimport com.clivern.decoy.SchemaDraft3;\n\n\n// For SchemaDraft3\nSchemaDraft3 schemaDraft3 = schemaFactory.unserialize(\n    fileReader.readFileAsString(\"path/to/endpoint/schema03_definition.json\"),\n    SchemaDraft3.class\n);\n\nvalidator.validate(schemaDraft3, \"{...JSON_DATA_HERE...}\");  // returns Boolean (true || false)\nvalidator.hasErrors();                                       // returns Boolean (true || false)\nvalidator.getErrors();                                       // returns ArrayList\u003cString\u003e\n```\n\n```java\nimport com.clivern.decoy.SchemaDraft4;\n\n\n// For SchemaDraft4\nSchemaDraft4 schemaDraft4 = schemaFactory.unserialize(\n    fileReader.readFileAsString(\"path/to/endpoint/schema04_definition.json\"),\n    SchemaDraft4.class\n);\n\nvalidator.validate(schemaDraft4, \"{...JSON_DATA_HERE...}\");  // returns Boolean (true || false)\nvalidator.hasErrors();                                       // returns Boolean (true || false)\nvalidator.getErrors();                                       // returns ArrayList\u003cString\u003e\n```\n\n```java\nimport com.clivern.decoy.SchemaDraft6;\n\n\n// For SchemaDraft6\nSchemaDraft6 schemaDraft6 = schemaFactory.unserialize(\n    fileReader.readFileAsString(\"path/to/endpoint/schema06_definition.json\"),\n    SchemaDraft6.class\n);\n\nvalidator.validate(schemaDraft6, \"{...JSON_DATA_HERE...}\");  // returns Boolean (true || false)\nvalidator.hasErrors();                                       // returns Boolean (true || false)\nvalidator.getErrors();                                       // returns ArrayList\u003cString\u003e\n```\n\n```java\nimport com.clivern.decoy.SchemaDraft7;\n\n\n// For SchemaDraft7\nSchemaDraft7 schemaDraft7 = schemaFactory.unserialize(\n    fileReader.readFileAsString(\"path/to/endpoint/schema07_definition.json\"),\n    SchemaDraft7.class\n);\n\nvalidator.validate(schemaDraft7, \"{...JSON_DATA_HERE...}\");  // returns Boolean (true || false)\nvalidator.hasErrors();                                       // returns Boolean (true || false)\nvalidator.getErrors();                                       // returns ArrayList\u003cString\u003e\n```\n\n\n### Examples\n\n```java\n#\n```\n\n## Versioning\n\nFor transparency into our release cycle and in striving to maintain backward compatibility, Decoy is maintained under the [Semantic Versioning guidelines](https://semver.org/) and release process is predictable and business-friendly.\n\nSee the [Releases section of our GitHub project](https://github.com/clivern/decoy/releases) for changelogs for each release version of Decoy. It contains summaries of the most noteworthy changes made in each release.\n\n\n## Bug tracker\n\nIf you have any suggestions, bug reports, or annoyances please report them to our issue tracker at https://github.com/clivern/decoy/issues\n\n\n## Security Issues\n\nIf you discover a security vulnerability within Decoy, please send an email to [hello@clivern.com](mailto:hello@clivern.com)\n\n\n## Contributing\n\nWe are an open source, community-driven project so please feel free to join us. see the [contributing guidelines](CONTRIBUTING.md) for more details.\n\n\n## License\n\n© 2019, Clivern. Released under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).\n\n**Decoy** is authored and maintained by [@Clivern](http://github.com/clivern).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclivern%2Fdecoy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclivern%2Fdecoy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclivern%2Fdecoy/lists"}