A Gradle custom task for validating a JSON document using JSON Schema.
buildscript {
repositories {
mavenCentral()
maven(url = "https://jitpack.io")
maven(url = "https://dl.bintray.com/michaelbull/maven")
}
dependencies {
classpath("com.michael-bull.gradle-json-schema:gradle-json-schema:1.0.0")
}
}import com.github.michaelbull.gradle.json.ValidateSchema
val validateExamples by tasks.registering(ValidateSchema::class) {
description = "Validate example files"
schema.set(file("example.schema.json"))
inputDir.set(layout.projectDirectory.dir("input"))
report.set(reporting.baseDirectory.file("example-report.json"))
validator {
failEarly()
}
}Bug reports and pull requests are welcome on GitHub.
This project is available under the terms of the ISC license. See the
LICENSE file for the copyright information and licensing terms.