From 310970959b04d4436f530c99e1ea1b16da363a94 Mon Sep 17 00:00:00 2001 From: Alvaro Cabrera <pateketrueke@gmail.com> Date: Thu, 4 Dec 2014 18:37:43 -0600 Subject: [PATCH] All combinations must resolve recursively; fix --- lib/util/traverse.js | Bin 1190 -> 1382 bytes spec/core/issues/allOf.json | 54 ++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 spec/core/issues/allOf.json diff --git a/lib/util/traverse.js b/lib/util/traverse.js index 254cdefec5e755b3e86cc31c2030e58fe9a0171a..442d52b64c6a500caad1abaa57d21640f782c83e 100644 GIT binary patch delta 133 zcmZ3+`HXAA!O7>Cr6)gUmYvMRA|Illrlz2%k)2wpU~6lupq`pnnyao*Q=<SEDM~FY z%`8eyQP<Q|sOD0Df}+%v(&SW)vc#OyR84EBa4ndw<=VK1k8yGcliTD|jJ-TimHA0o Mn%0|VGVwA20B~|A0{{R3 delta 24 gcmaFHwTyGZ!Oew?oQ#tXF!fHZWpdse#mvJ50C}nibpQYW diff --git a/spec/core/issues/allOf.json b/spec/core/issues/allOf.json new file mode 100644 index 00000000..1d01ad7f --- /dev/null +++ b/spec/core/issues/allOf.json @@ -0,0 +1,54 @@ +[ + { + "description": "sub-schema mixins", + "schemas": [ + { + "type": "object", + "definitions": { + "inner": { + "aString": { + "allOf": [ + { "type": "string" }, + { "$ref": "#/definitions/rules" } + ] + } + }, + "rules": { + "allOf": [ + { "$ref": "#/definitions/twoChars" }, + { "$ref": "#/definitions/asEmail" } + ] + }, + "twoChars": { + "minLength": 10 + }, + "asEmail": { + "faker": "internet.email" + } + }, + "properties": { + "anArray": { + "type": "array", + "items": { + "type": "object", + "properties": { + "allOf": [ + { "$ref": "#/definitions/inner" } + ] + }, + "required": ["aString"] + } + } + }, + "required": ["anArray"] + } + ], + "tests": [ + { + "description": "should combine recursively", + "schema": "schemas.0", + "valid": true + } + ] + } +] -- GitLab