diff options
Diffstat (limited to 'config-model')
4 files changed, 27 insertions, 0 deletions
diff --git a/config-model/src/main/Makefile b/config-model/src/main/Makefile index dea2aa9e9fe..b1c37f4889f 100644 --- a/config-model/src/main/Makefile +++ b/config-model/src/main/Makefile @@ -31,6 +31,12 @@ resources/schema/deployment.rng: resources/schema/deployment.rnc resources/schema/deployment.xsd: resources/schema/deployment.rng java -jar $(trangjar) -I rng -O xsd resources/schema/deployment.rng resources/schema/deployment.xsd +resources/schema/validation-overrides.rng: resources/schema/validation-overrides.rnc + java -jar $(trangjar) -I rnc -O rng resources/schema/validation-overrides.rnc resources/schema/validation-overrides.rng + +resources/schema/deployment.xsd: resources/schema/validation-overrides.rng + java -jar $(trangjar) -I rng -O xsd resources/schema/validation-overrides.rng resources/schema/validation-overrides.xsd + clean: rm -f resources/schema/*.rng rm -f resources/schema/*.xsd diff --git a/config-model/src/main/resources/schema/validation-overrides.rnc b/config-model/src/main/resources/schema/validation-overrides.rnc new file mode 100644 index 00000000000..f5af03f7f03 --- /dev/null +++ b/config-model/src/main/resources/schema/validation-overrides.rnc @@ -0,0 +1,13 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# RELAX NG Compact Syntax +# Vespa validation overrides + +start = element validation-overrides { + Allow* +} + +Allow = element allow { + attribute until { xsd:string } & + attribute comment { xsd:string }? & + text +} diff --git a/config-model/src/test/schema-test-files/validation-overrides.xml b/config-model/src/test/schema-test-files/validation-overrides.xml new file mode 100644 index 00000000000..3b8b4f290be --- /dev/null +++ b/config-model/src/test/schema-test-files/validation-overrides.xml @@ -0,0 +1,4 @@ +<validation-overrides> + <allow until="2017-01-01" comment="Some change">field-type-change</allow> + <allow until="2017-02-01">cluster-size-reduction</allow> +</validation-overrides> diff --git a/config-model/src/test/sh/test-schema.sh b/config-model/src/test/sh/test-schema.sh index 535a7008589..ad2a8a81117 100755 --- a/config-model/src/test/sh/test-schema.sh +++ b/config-model/src/test/sh/test-schema.sh @@ -31,3 +31,7 @@ $cmd cmd="java -jar $jar src/main/resources/schema/deployment.rng src/test/schema-test-files/deployment.xml" echo $cmd $cmd + +cmd="java -jar $jar src/main/resources/schema/validation-overrides.rng src/test/schema-test-files/validation-overrides.xml" +echo $cmd +$cmd |