File tree Expand file tree Collapse file tree 2 files changed +63
-0
lines changed
java/com/networknt/schema Expand file tree Collapse file tree 2 files changed +63
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2016 Network New Technologies Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package com .networknt .schema ;
18
+
19
+ import org .junit .Ignore ;
20
+ import org .junit .Test ;
21
+
22
+ /**
23
+ * Created by stevehu on 2016-12-20.
24
+ */
25
+ public class SelfRefTest extends BaseJsonSchemaValidatorTest {
26
+ @ Ignore ("This test currently is failing because of a StackOverflow caused by a recursive $ref." )
27
+ @ Test ()
28
+ public void testSelfRef () throws Exception {
29
+ JsonSchema node = getJsonSchemaFromClasspath ("selfRef.json" );
30
+ System .out .println ("node = " + node );
31
+ }
32
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " object" ,
3
+ "properties" : {
4
+ "name" : {
5
+ "type" : " string"
6
+ },
7
+ "tree" : {
8
+ "$ref" : " #/definitions/tree"
9
+ }
10
+ },
11
+ "definitions" : {
12
+ "tree" : {
13
+ "type" : " object" ,
14
+ "properties" : {
15
+ "value" : {
16
+ "type" : " string"
17
+ },
18
+ "branches" : {
19
+ "type" : " array" ,
20
+ "items" : {
21
+ "$ref" : " #/definitions/tree"
22
+ },
23
+ "minItems" : 1
24
+ }
25
+ },
26
+ "required" : [
27
+ " value"
28
+ ]
29
+ }
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments