Previously, users that wanted to document a request field’s constraints had to roll their own solution. This commit introduces a new API that makes it easier to document constraints. Support is provided for discovering Bean Validation constraints and resolving descriptions for them. The constraint descriptions can then be used as required. For example, they can included in a field’s description or in an additional constraints attribute that’s included in an additional table column via the use of a custom snippet template. Closes gh-42
23 lines
564 B
Groovy
23 lines
564 B
Groovy
plugins {
|
|
id 'org.asciidoctor.convert' version '1.5.2'
|
|
}
|
|
|
|
dependencies {
|
|
compile 'org.springframework:spring-webmvc'
|
|
|
|
testCompile project(':spring-restdocs')
|
|
testCompile 'javax.validation:validation-api'
|
|
testCompile 'junit:junit'
|
|
testCompile 'org.springframework:spring-test'
|
|
}
|
|
|
|
tasks.findByPath("artifactoryPublish")?.enabled = false
|
|
|
|
asciidoctor {
|
|
sources {
|
|
include 'index.adoc'
|
|
}
|
|
attributes 'revnumber': project.version,
|
|
'branch-or-tag': project.version.endsWith('SNAPSHOT') ? 'master': "v${project.version}"
|
|
inputs.files(sourceSets.test.java)
|
|
} |