{"id":20456385,"url":"https://github.com/alenkacz/gradle-json-validator","last_synced_at":"2025-04-13T04:02:00.530Z","repository":{"id":45865335,"uuid":"49770576","full_name":"alenkacz/gradle-json-validator","owner":"alenkacz","description":"Gradle plugin for json validation","archived":false,"fork":false,"pushed_at":"2021-12-19T08:31:12.000Z","size":113,"stargazers_count":10,"open_issues_count":6,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T21:02:48.499Z","etag":null,"topics":["gradle","json-schema","json-schema-validator","json-validation"],"latest_commit_sha":null,"homepage":null,"language":"Groovy","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/alenkacz.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":"2016-01-16T11:25:09.000Z","updated_at":"2021-12-18T04:17:45.000Z","dependencies_parsed_at":"2022-09-14T12:01:41.575Z","dependency_job_id":null,"html_url":"https://github.com/alenkacz/gradle-json-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/alenkacz%2Fgradle-json-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alenkacz%2Fgradle-json-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alenkacz%2Fgradle-json-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alenkacz%2Fgradle-json-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alenkacz","download_url":"https://codeload.github.com/alenkacz/gradle-json-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661706,"owners_count":21141450,"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":["gradle","json-schema","json-schema-validator","json-validation"],"created_at":"2024-11-15T11:22:27.615Z","updated_at":"2025-04-13T04:02:00.470Z","avatar_url":"https://github.com/alenkacz.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gradle-json-validator\n\n[![Build Status](https://travis-ci.org/alenkacz/gradle-json-validator.svg)](https://travis-ci.org/alenkacz/gradle-json-validator) [ ![Download](https://api.bintray.com/packages/alenkacz/maven/gradle-json-validator/images/download.svg) ](https://bintray.com/alenkacz/maven/gradle-json-validator/_latestVersion)\n\nProvides json validation as a part of your gradle build pipeline.\n\nThis plugin implements a custom task type, [ValidateJsonTask](https://github.com/alenkacz/gradle-json-validator/blob/master/src/main/groovy/cz/alenkacz/gradle/jsonvalidator/ValidateJsonTask.groovy). This task expects two properties - *targetJsonFile* and *jsonSchemaFile* (instead of *targetJsonFile* you can use *targetJsonDirectory* and then all files in that directory will be validated). If that directory contains both json and non-json files, the task will fail for non-json files. If you want to validate only files with .json extension use the `onlyWithJsonExtension` property. If you need to validate more jsons as a part of one build, you will have to create as many custom tasks as the number of json schema files (see *validateCustomJson* in the example below).\n\nUsage\n====================\n\n\tbuildscript {\n\t\trepositories {\n\t\t\tjcenter()\n\t\t}\n\t\tdependencies {\n\t\t\tclasspath 'cz.alenkacz.gradle:json-validator:FILL_VERSION_HERE'\n\t\t}\n\t}\n\n\tapply plugin: 'json-validator'\n\t\n    import cz.alenkacz.gradle.jsonvalidator.ValidateJsonTask\n    \n    task validateCustomJson(type: ValidateJsonTask) {\n      targetJsonFile = file(\"target.json\") // only one of targetJsonFile or targetJsonDirectory can be specified \n      targetJsonDirectory = file(\"directoryWithJsons\") // only one of targetJsonFile or targetJsonDirectory can be specified\n      jsonSchema = file(\"schema.json\")\n      onlyWithJsonExtension = true // default is false, this makes sense only when using targetJsonDirectory, it ignores all files apart from those who do not have .json file extension\n    }\n\nJSON schema syntax check\n====================\nFor some build pipelines it might be useful to be able to check schema files for syntax errors as a part of the build. To make that work, use the following setup and run the task **validateJsonSchema**:\n\n\n\tbuildscript {\n\t\trepositories {\n\t\t\tjcenter()\n\t\t}\n\t\tdependencies {\n\t\t\tclasspath 'cz.alenkacz.gradle:json-validator:FILL_VERSION_HERE'\n\t\t}\n\t}\n\n\tapply plugin: 'json-validator'\n\t\n    jsonSchema {\n        schemaFolder = PATH_TO_YOUR_FOLDER_WITH_JSON_SCHEMAS\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falenkacz%2Fgradle-json-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falenkacz%2Fgradle-json-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falenkacz%2Fgradle-json-validator/lists"}