Skip to content

Commit 6f74063

Browse files
committed
ref with quote
1 parent 5bb7a0d commit 6f74063

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

tests/draft4/ref.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,5 +296,32 @@
296296
"valid": false
297297
}
298298
]
299+
},
300+
{
301+
"description": "refs with quote",
302+
"schema": {
303+
"properties": {
304+
"foo\"bar": {"$ref": "#/definitions/foo\"bar"}
305+
},
306+
"definitions": {
307+
"foo\"bar": {"type": "number"}
308+
}
309+
},
310+
"tests": [
311+
{
312+
"description": "object with numbers is valid",
313+
"data": {
314+
"foo\"bar": 1
315+
},
316+
"valid": true
317+
},
318+
{
319+
"description": "object with strings is invalid",
320+
"data": {
321+
"foo\"bar": "1"
322+
},
323+
"valid": false
324+
}
325+
]
299326
}
300327
]

tests/draft6/ref.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,5 +328,32 @@
328328
"valid": false
329329
}
330330
]
331+
},
332+
{
333+
"description": "refs with quote",
334+
"schema": {
335+
"properties": {
336+
"foo\"bar": {"$ref": "#/definitions/foo\"bar"}
337+
},
338+
"definitions": {
339+
"foo\"bar": {"type": "number"}
340+
}
341+
},
342+
"tests": [
343+
{
344+
"description": "object with numbers is valid",
345+
"data": {
346+
"foo\"bar": 1
347+
},
348+
"valid": true
349+
},
350+
{
351+
"description": "object with strings is invalid",
352+
"data": {
353+
"foo\"bar": "1"
354+
},
355+
"valid": false
356+
}
357+
]
331358
}
332359
]

tests/draft7/ref.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,5 +328,32 @@
328328
"valid": false
329329
}
330330
]
331+
},
332+
{
333+
"description": "refs with quote",
334+
"schema": {
335+
"properties": {
336+
"foo\"bar": {"$ref": "#/definitions/foo\"bar"}
337+
},
338+
"definitions": {
339+
"foo\"bar": {"type": "number"}
340+
}
341+
},
342+
"tests": [
343+
{
344+
"description": "object with numbers is valid",
345+
"data": {
346+
"foo\"bar": 1
347+
},
348+
"valid": true
349+
},
350+
{
351+
"description": "object with strings is invalid",
352+
"data": {
353+
"foo\"bar": "1"
354+
},
355+
"valid": false
356+
}
357+
]
331358
}
332359
]

0 commit comments

Comments
 (0)