Skip to content

Commit 2393a65

Browse files
authored
Merge branch 'master' into rfc-6531
2 parents 70ae8c0 + 2f21097 commit 2393a65

File tree

16 files changed

+332
-157
lines changed

16 files changed

+332
-157
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ target
44
build
55
.gradle
66
out
7+
/.nb-gradle/

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ timely manner.
3333
## Testing online
3434

3535
You can [test this library online](http://json-schema-validator.herokuapp.com); this web site is in
36-
a [project of its own](https://github.com/java-json-tools/json-schema-validator-demo), which you can fork and
36+
a [project of its own](https://github.com/fge/json-schema-validator-demo), which you can fork and
3737
run by yourself.
3838

3939
## Versions
4040

41-
* current stable version: **2.2.6**
41+
* current stable version: **2.2.10**
4242
([ChangeLog](https://github.com/java-json-tools/json-schema-validator/wiki/ChangeLog_22x),
4343
[Javadoc](http://java-json-tools.github.io/json-schema-validator/2.2.x/index.html), [code
4444
samples](http://java-json-tools.github.io/json-schema-validator/2.2.x/index.html?com/github/fge/jsonschema/examples/package-summary.html)).
@@ -57,7 +57,7 @@ Gradle:
5757

5858
```groovy
5959
dependencies {
60-
compile(group: "com.github.java-json-tools", name: "json-schema-validator", version: "2.2.8");
60+
compile(group: "com.github.java-json-tools", name: "json-schema-validator", version: "2.2.10");
6161
}
6262
```
6363

@@ -67,7 +67,7 @@ Maven:
6767
<dependency>
6868
<groupId>com.github.java-json-tools</groupId>
6969
<artifactId>json-schema-validator</artifactId>
70-
<version>2.2.8</version>
70+
<version>2.2.10</version>
7171
</dependency>
7272
```
7373

build.gradle

+9-9
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ apply(plugin: "idea");
2525
apply(plugin: "eclipse");
2626

2727
group = "com.github.java-json-tools";
28-
version = "2.2.8";
28+
version = "2.2.10-SNAPSHOT";
2929
sourceCompatibility = "1.6";
3030
targetCompatibility = "1.6"; // defaults to sourceCompatibility
3131

@@ -40,11 +40,12 @@ repositories {
4040
* List of dependencies
4141
*/
4242
dependencies {
43-
compile(group: "com.github.java-json-tools", name: "json-schema-core", version: "1.2.8");
43+
=======
44+
compile(group: "com.github.java-json-tools", name: "json-schema-core", version: "1.2.9");
4445
compile(group: "com.sun.mail", name: "mailapi", version: "1.6.1");
4546
compile(group: "joda-time", name: "joda-time", version: "2.9.7");
4647
compile(group: "com.googlecode.libphonenumber", name: "libphonenumber", version: "8.0.0");
47-
compile(group: "com.google.code.findbugs", name: "jsr305", version: "3.0.1");
48+
compile(group: "com.google.code.findbugs", name: "jsr305", version: "3.0.2");
4849
compile(group: "net.sf.jopt-simple", name: "jopt-simple", version: "5.0.3");
4950
testCompile(group: "org.testng", name: "testng", version: "6.10") {
5051
exclude(group: "junit", module: "junit");
@@ -56,10 +57,10 @@ dependencies {
5657
}
5758

5859
javadoc.options.links("http://docs.oracle.com/javase/6/docs/api/");
59-
javadoc.options.links("http://jsr-305.googlecode.com/svn/trunk/javadoc/");
60+
javadoc.options.links("http://www.javadoc.io/doc/com.google.code.findbugs/jsr305/3.0.1/");
6061
javadoc.options.links("http://fasterxml.github.com/jackson-databind/javadoc/2.2.0/");
6162
javadoc.options.links("http://fasterxml.github.com/jackson-core/javadoc/2.2.0/");
62-
javadoc.options.links("http://docs.guava-libraries.googlecode.com/git-history/v16.0.1/javadoc/");
63+
javadoc.options.links("http://www.javadoc.io/doc/com.google.guava/guava/16.0.1/");
6364
javadoc.options.links("http://fge.github.io/btf/");
6465
javadoc.options.links("http://fge.github.io/msg-simple/");
6566
javadoc.options.links("http://fge.github.io/jackson-coreutils/");
@@ -94,7 +95,6 @@ task sourcesJar(type: Jar, dependsOn: classes) {
9495

9596
javadoc.options {
9697
overview = "src/main/javadoc/overview.html";
97-
extDirs = [ file("src/main/javadoc") ];
9898
docFilesSubDirs = true;
9999
}
100100

@@ -142,8 +142,8 @@ artifacts {
142142
archives libJar;
143143
}
144144

145-
task wrapper(type: Wrapper) {
146-
gradleVersion = "3.5";
145+
wrapper {
146+
gradleVersion = "5.6.1";
147147
distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip";
148148
}
149149

@@ -172,7 +172,7 @@ task checkSigningRequirements {
172172
requiredProperties.each {
173173
if (project.properties[it] == null) {
174174
noDice = true;
175-
System.err.printf("property \"%s\" is not defined!", it);
175+
System.err.printf("property \"%s\" is not defined!\n", it);
176176
}
177177
}
178178
if (noDice)

gradle/wrapper/gradle-wrapper.jar

4.4 KB
Binary file not shown.
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 02 16:48:25 PDT 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=http\://services.gradle.org/distributions/gradle-5.6.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=http\://services.gradle.org/distributions/gradle-3.5-all.zip

gradlew

+61-37
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,59 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
2+
3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
218

319
##############################################################################
420
##
521
## Gradle start up script for UN*X
622
##
723
##############################################################################
824

9-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10-
DEFAULT_JVM_OPTS=""
25+
# Attempt to set APP_HOME
26+
# Resolve links: $0 may be a link
27+
PRG="$0"
28+
# Need this for relative symlinks.
29+
while [ -h "$PRG" ] ; do
30+
ls=`ls -ld "$PRG"`
31+
link=`expr "$ls" : '.*-> \(.*\)$'`
32+
if expr "$link" : '/.*' > /dev/null; then
33+
PRG="$link"
34+
else
35+
PRG=`dirname "$PRG"`"/$link"
36+
fi
37+
done
38+
SAVED="`pwd`"
39+
cd "`dirname \"$PRG\"`/" >/dev/null
40+
APP_HOME="`pwd -P`"
41+
cd "$SAVED" >/dev/null
1142

1243
APP_NAME="Gradle"
1344
APP_BASE_NAME=`basename "$0"`
1445

46+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48+
1549
# Use the maximum available, or set MAX_FD != -1 to use that value.
1650
MAX_FD="maximum"
1751

18-
warn ( ) {
52+
warn () {
1953
echo "$*"
2054
}
2155

22-
die ( ) {
56+
die () {
2357
echo
2458
echo "$*"
2559
echo
@@ -30,6 +64,7 @@ die ( ) {
3064
cygwin=false
3165
msys=false
3266
darwin=false
67+
nonstop=false
3368
case "`uname`" in
3469
CYGWIN* )
3570
cygwin=true
@@ -40,31 +75,11 @@ case "`uname`" in
4075
MINGW* )
4176
msys=true
4277
;;
78+
NONSTOP* )
79+
nonstop=true
80+
;;
4381
esac
4482

45-
# For Cygwin, ensure paths are in UNIX format before anything is touched.
46-
if $cygwin ; then
47-
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48-
fi
49-
50-
# Attempt to set APP_HOME
51-
# Resolve links: $0 may be a link
52-
PRG="$0"
53-
# Need this for relative symlinks.
54-
while [ -h "$PRG" ] ; do
55-
ls=`ls -ld "$PRG"`
56-
link=`expr "$ls" : '.*-> \(.*\)$'`
57-
if expr "$link" : '/.*' > /dev/null; then
58-
PRG="$link"
59-
else
60-
PRG=`dirname "$PRG"`"/$link"
61-
fi
62-
done
63-
SAVED="`pwd`"
64-
cd "`dirname \"$PRG\"`/" >&-
65-
APP_HOME="`pwd -P`"
66-
cd "$SAVED" >&-
67-
6883
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
6984

7085
# Determine the Java command to use to start the JVM.
@@ -90,7 +105,7 @@ location of your Java installation."
90105
fi
91106

92107
# Increase the maximum file descriptors if we can.
93-
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
108+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
94109
MAX_FD_LIMIT=`ulimit -H -n`
95110
if [ $? -eq 0 ] ; then
96111
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -110,10 +125,11 @@ if $darwin; then
110125
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111126
fi
112127

113-
# For Cygwin, switch paths to Windows format before running java
114-
if $cygwin ; then
128+
# For Cygwin or MSYS, switch paths to Windows format before running java
129+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
115130
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132+
JAVACMD=`cygpath --unix "$JAVACMD"`
117133

118134
# We build the pattern for arguments to be converted via cygpath
119135
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +170,19 @@ if $cygwin ; then
154170
esac
155171
fi
156172

157-
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158-
function splitJvmOpts() {
159-
JVM_OPTS=("$@")
173+
# Escape application args
174+
save () {
175+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176+
echo " "
160177
}
161-
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162-
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
178+
APP_ARGS=$(save "$@")
179+
180+
# Collect all arguments for the java command, following the shell quoting and substitution rules
181+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182+
183+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185+
cd "$(dirname "$0")"
186+
fi
163187

164-
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
188+
exec "$JAVACMD" "$@"

gradlew.bat

+20-10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -8,14 +24,14 @@
824
@rem Set local scope for the variables with windows NT shell
925
if "%OS%"=="Windows_NT" setlocal
1026

11-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12-
set DEFAULT_JVM_OPTS=
13-
1427
set DIRNAME=%~dp0
1528
if "%DIRNAME%" == "" set DIRNAME=.
1629
set APP_BASE_NAME=%~n0
1730
set APP_HOME=%DIRNAME%
1831

32+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34+
1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome
2137

@@ -46,10 +62,9 @@ echo location of your Java installation.
4662
goto fail
4763

4864
:init
49-
@rem Get command-line arguments, handling Windowz variants
65+
@rem Get command-line arguments, handling Windows variants
5066

5167
if not "%OS%" == "Windows_NT" goto win9xME_args
52-
if "%@eval[2+2]" == "4" goto 4NT_args
5368

5469
:win9xME_args
5570
@rem Slurp the command line arguments.
@@ -60,11 +75,6 @@ set _SKIP=2
6075
if "x%~1" == "x" goto execute
6176

6277
set CMD_LINE_ARGS=%*
63-
goto execute
64-
65-
:4NT_args
66-
@rem Get arguments from the 4NT Shell from JP Software
67-
set CMD_LINE_ARGS=%$
6878

6979
:execute
7080
@rem Setup the command line

src/main/java/com/github/fge/jsonschema/format/common/RFC3339DateTimeAttribute.java

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import java.util.List;
44

5+
import com.github.fge.jsonschema.cfg.ValidationConfiguration;
6+
import com.github.fge.jsonschema.library.DraftV4Library;
57
import org.joda.time.format.DateTimeFormatter;
68
import org.joda.time.format.DateTimeFormatterBuilder;
79
import org.joda.time.format.DateTimeParser;
@@ -18,6 +20,13 @@
1820
/**
1921
* A {@link DateTimeFormatter} for date and time format defined in RFC3339.
2022
* @see <a href="https://tools.ietf.org/html/rfc3339#section-5.6">RFC 3339 - Section 5.6</a>
23+
*
24+
* This is backwards incompat with the original DateTimeAttribute. It will become the default in the future
25+
* to use it currently you need to:
26+
* Library library = DraftV4Library.get().thaw()
27+
* .addFormatAttribute("date-time", RFC3339DateTimeAttribute.getInstance())
28+
* .freeze();
29+
* Then follow the rest of the steps in example 8 to hook it into your flow.
2130
*/
2231
public class RFC3339DateTimeAttribute extends AbstractFormatAttribute {
2332

src/main/java/com/github/fge/jsonschema/format/helpers/AbstractDateFormatAttribute.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public final void validate(final ProcessingReport report,
6161
final String value = data.getInstance().getNode().textValue();
6262

6363
try {
64-
formatter.parseDateTime(value);
64+
formatter.parseLocalDate(value);
6565
} catch (IllegalArgumentException ignored) {
6666
report.error(newMsg(data, bundle, "err.format.invalidDate")
6767
.putArgument("value", value).putArgument("expected", format));

src/main/java/com/github/fge/jsonschema/library/format/CommonFormatAttributesDictionary.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
import com.github.fge.jsonschema.core.util.Dictionary;
2323
import com.github.fge.jsonschema.core.util.DictionaryBuilder;
2424
import com.github.fge.jsonschema.format.FormatAttribute;
25+
import com.github.fge.jsonschema.format.common.DateTimeAttribute;
2526
import com.github.fge.jsonschema.format.common.EmailAttribute;
2627
import com.github.fge.jsonschema.format.common.IPv6Attribute;
27-
import com.github.fge.jsonschema.format.common.RFC3339DateTimeAttribute;
2828
import com.github.fge.jsonschema.format.common.RegexAttribute;
2929
import com.github.fge.jsonschema.format.common.URIAttribute;
3030

@@ -49,7 +49,7 @@ private CommonFormatAttributesDictionary()
4949
FormatAttribute attribute;
5050

5151
name = "date-time";
52-
attribute = RFC3339DateTimeAttribute.getInstance();
52+
attribute = DateTimeAttribute.getInstance();
5353
builder.addEntry(name, attribute);
5454

5555
name = "email";

0 commit comments

Comments
 (0)