File tree 2 files changed +36
-1
lines changed 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 59
59
"runkitExampleFilename" : " .runkit_example.js" ,
60
60
"dependencies" : {
61
61
"fast-deep-equal" : " ^3.1.3" ,
62
- "fast-uri" : " ^2.4.0 " ,
62
+ "fast-uri" : " ^3.0.1 " ,
63
63
"json-schema-traverse" : " ^1.0.0" ,
64
64
"require-from-string" : " ^2.0.2"
65
65
},
Original file line number Diff line number Diff line change @@ -180,6 +180,41 @@ uriResolvers.forEach((resolver) => {
180
180
} )
181
181
} )
182
182
183
+ describe ( "URIs with encoded characters (issue #2447)" , ( ) => {
184
+ it ( "should resolve the ref" , ( ) => {
185
+ const schema = {
186
+ $ref : "#/definitions/Record%3Cstring%2CPerson%3E" ,
187
+ $schema : "http://json-schema.org/draft-07/schema#" ,
188
+ definitions : {
189
+ Person : {
190
+ type : "object" ,
191
+ properties : {
192
+ firstName : {
193
+ type : "string" ,
194
+ description : "The person's first name." ,
195
+ } ,
196
+ } ,
197
+ } ,
198
+ "Record<string,Person>" : {
199
+ type : "object" ,
200
+ additionalProperties : {
201
+ $ref : "#/definitions/Person" ,
202
+ } ,
203
+ } ,
204
+ } ,
205
+ }
206
+ const data = {
207
+ joe : {
208
+ firstName : "Joe" ,
209
+ } ,
210
+ }
211
+ instances . forEach ( ( ajv ) => {
212
+ const validate = ajv . compile ( schema )
213
+ validate ( data ) . should . equal ( true )
214
+ } )
215
+ } )
216
+ } )
217
+
183
218
describe ( "missing schema error" , function ( ) {
184
219
this . timeout ( 4000 )
185
220
You can’t perform that action at this time.
0 commit comments