File tree Expand file tree Collapse file tree 3 files changed +105
-0
lines changed Expand file tree Collapse file tree 3 files changed +105
-0
lines changed Original file line number Diff line number Diff line change 134
134
"valid" : false
135
135
}
136
136
]
137
+ },
138
+ {
139
+ "description" : " same $anchor with different base uri" ,
140
+ "schema" : {
141
+ "$id" : " http://localhost:1234/foobar" ,
142
+ "$defs" : {
143
+ "A" : {
144
+ "$id" : " child1" ,
145
+ "allOf" : [
146
+ {
147
+ "$id" : " child2" ,
148
+ "$anchor" : " my_anchor" ,
149
+ "type" : " number"
150
+ },
151
+ {
152
+ "$anchor" : " my_anchor" ,
153
+ "type" : " string"
154
+ }
155
+ ]
156
+ }
157
+ },
158
+ "$ref" : " child1#my_anchor"
159
+ },
160
+ "tests" : [
161
+ {
162
+ "description" : " $ref should resolve to /$defs/A/allOf/1" ,
163
+ "data" : " a" ,
164
+ "valid" : true
165
+ },
166
+ {
167
+ "description" : " $ref should not resolve to /$defs/A/allOf/0" ,
168
+ "data" : 1 ,
169
+ "valid" : false
170
+ }
171
+ ]
137
172
}
138
173
]
Original file line number Diff line number Diff line change 134
134
"valid" : false
135
135
}
136
136
]
137
+ },
138
+ {
139
+ "description" : " same $anchor with different base uri" ,
140
+ "schema" : {
141
+ "$id" : " http://localhost:1234/foobar" ,
142
+ "$defs" : {
143
+ "A" : {
144
+ "$id" : " child1" ,
145
+ "allOf" : [
146
+ {
147
+ "$id" : " child2" ,
148
+ "$anchor" : " my_anchor" ,
149
+ "type" : " number"
150
+ },
151
+ {
152
+ "$anchor" : " my_anchor" ,
153
+ "type" : " string"
154
+ }
155
+ ]
156
+ }
157
+ },
158
+ "$ref" : " child1#my_anchor"
159
+ },
160
+ "tests" : [
161
+ {
162
+ "description" : " $ref should resolve to /$defs/A/allOf/1" ,
163
+ "data" : " a" ,
164
+ "valid" : true
165
+ },
166
+ {
167
+ "description" : " $ref should not resolve to /$defs/A/allOf/0" ,
168
+ "data" : 1 ,
169
+ "valid" : false
170
+ }
171
+ ]
137
172
}
138
173
]
Original file line number Diff line number Diff line change 134
134
"valid" : false
135
135
}
136
136
]
137
+ },
138
+ {
139
+ "description" : " same $anchor with different base uri" ,
140
+ "schema" : {
141
+ "$id" : " http://localhost:1234/foobar" ,
142
+ "$defs" : {
143
+ "A" : {
144
+ "$id" : " child1" ,
145
+ "allOf" : [
146
+ {
147
+ "$id" : " child2" ,
148
+ "$anchor" : " my_anchor" ,
149
+ "type" : " number"
150
+ },
151
+ {
152
+ "$anchor" : " my_anchor" ,
153
+ "type" : " string"
154
+ }
155
+ ]
156
+ }
157
+ },
158
+ "$ref" : " child1#my_anchor"
159
+ },
160
+ "tests" : [
161
+ {
162
+ "description" : " $ref should resolve to /$defs/A/allOf/1" ,
163
+ "data" : " a" ,
164
+ "valid" : true
165
+ },
166
+ {
167
+ "description" : " $ref should not resolve to /$defs/A/allOf/0" ,
168
+ "data" : 1 ,
169
+ "valid" : false
170
+ }
171
+ ]
137
172
}
138
173
]
You can’t perform that action at this time.
0 commit comments