File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 5959 "runkitExampleFilename" : " .runkit_example.js" ,
6060 "dependencies" : {
6161 "fast-deep-equal" : " ^3.1.3" ,
62- "fast-uri" : " ^2.4.0 " ,
62+ "fast-uri" : " ^3.0.1 " ,
6363 "json-schema-traverse" : " ^1.0.0" ,
6464 "require-from-string" : " ^2.0.2"
6565 },
Original file line number Diff line number Diff line change @@ -180,6 +180,41 @@ uriResolvers.forEach((resolver) => {
180180 } )
181181 } )
182182
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+
183218 describe ( "missing schema error" , function ( ) {
184219 this . timeout ( 4000 )
185220
You can’t perform that action at this time.
0 commit comments