fix($schema): Removes 'sounds' from required array in JSON schema

Removes 'sounds' from required array in JSON schema as to resolve edge case discovered in GH-13

GH-13
This commit is contained in:
Andrew Sliwinski 2017-09-01 19:53:17 -03:00
parent 040933fc56
commit 9322967b5c
2 changed files with 402 additions and 1 deletions

View file

@ -198,7 +198,6 @@
},
"required": [
"objName",
"sounds",
"costumes",
"currentCostumeIndex",
"penLayerMD5",

402
test/fixtures/data/165661752.json vendored Normal file
View file

@ -0,0 +1,402 @@
{
"objName": "Stage",
"costumes": [{
"costumeName": "Picture1",
"baseLayerID": -1,
"baseLayerMD5": "bd6e3ee65e27682cff445b05f082125f.png",
"bitmapResolution": 2,
"rotationCenterX": 480,
"rotationCenterY": 360
},
{
"costumeName": "backdrop1",
"baseLayerID": -1,
"baseLayerMD5": "4b98c07876ed8997c3762e75790507b4.svg",
"bitmapResolution": 1,
"rotationCenterX": 246,
"rotationCenterY": 185
}],
"currentCostumeIndex": 0,
"penLayerMD5": "5c81a336fab8be57adc039a8a2b33ca9.png",
"penLayerID": -1,
"tempoBPM": 40,
"videoAlpha": 0.5,
"children": [{
"objName": "Balloon1",
"scripts": [[10, 10, [["whenGreenFlag"], ["hide"]]],
[10,
82,
[["procDef", "balloon", [], [], false],
["show"],
["goBackByLayers:", 5],
["gotoSpriteOrMouse:", "_random_"],
["ypos:", 180],
["doRepeat", 20, [["changeYposBy:", -5]]]]],
[247,
238,
[["whenCloned"], ["doForever", [["changeGraphicEffect:by:", "color", 25], ["wait:elapsed:from:", 0.2]]]]],
[247, 133, [["whenCloned"], ["call", "balloon"], ["wait:elapsed:from:", 2], ["deleteClone"]]],
[10, 285, [["whenSceneStarts", "backdrop1"], ["hide"]]],
[247,
10,
[["whenIReceive", "message5"], ["doRepeat", 4, [["createCloneOf", "_myself_"], ["wait:elapsed:from:", 1]]]]]],
"sounds": [{
"soundName": "pop",
"soundID": -1,
"md5": "83a9787d4cb6f3b7632b4ddfebf74367.wav",
"sampleCount": 258,
"rate": 11025,
"format": ""
}],
"costumes": [{
"costumeName": "balloon1-a",
"baseLayerID": -1,
"baseLayerMD5": "bc96a1fb5fe794377acd44807e421ce2.svg",
"bitmapResolution": 1,
"rotationCenterX": 32,
"rotationCenterY": 94
},
{
"costumeName": "balloon1-b",
"baseLayerID": -1,
"baseLayerMD5": "d7bb51d9c38af6314bd2b4058d2a592d.svg",
"bitmapResolution": 1,
"rotationCenterX": 31,
"rotationCenterY": 94
},
{
"costumeName": "balloon1-c",
"baseLayerID": -1,
"baseLayerMD5": "247cef27b665d77d9efaca69327cae77.svg",
"bitmapResolution": 1,
"rotationCenterX": 31,
"rotationCenterY": 94
}],
"currentCostumeIndex": 0,
"scratchX": -67,
"scratchY": 80,
"scale": 0.7,
"direction": 90,
"rotationStyle": "normal",
"isDraggable": false,
"indexInLibrary": 6,
"visible": false,
"spriteInfo": {
}
},
{
"objName": "Sprite1",
"scripts": [[631,
10,
[["whenGreenFlag"],
["doRepeat", 4, [["playSound:", "C major ukulele"], ["playSound:", "C major ukulele"], ["wait:elapsed:from:", 0.15]]]]],
[10,
10,
[["whenIReceive", "message2"],
["doRepeat", 4, [["playSound:", "F major ukulele"], ["playSound:", "F major ukulele"], ["wait:elapsed:from:", 0.15]]]]],
[10,
155,
[["whenIReceive", "message3"],
["doRepeat", 4, [["playSound:", "C major ukulele"], ["playSound:", "C major ukulele"], ["wait:elapsed:from:", 0.15]]],
["broadcast:", "message4"]]],
[466,
10,
[["whenIReceive", "message1"],
["doRepeat", 4, [["playSound:", "G ukulele"], ["playSound:", "G ukulele"], ["wait:elapsed:from:", 0.15]]]]],
[10, 322, [["whenSceneStarts", "backdrop1"], ["hide"]]],
[247,
125,
[["whenIReceive", "message4"],
["wait:elapsed:from:", 0.5],
["doPlaySoundAndWait", "crash cymbal"],
["broadcast:", "message5"],
["doRepeat",
4,
[["playSound:", "C major ukulele"],
["playSound:", "C major ukulele"],
["wait:elapsed:from:", 0.15],
["playSound:", "F major ukulele"],
["playSound:", "F major ukulele"],
["wait:elapsed:from:", 0.15],
["playSound:", "G ukulele"],
["playSound:", "G ukulele"],
["wait:elapsed:from:", 0.15]]],
["wait:elapsed:from:", 2],
["startScene", "backdrop1"]]],
[247,
10,
[["whenGreenFlag"], ["show"], ["say:duration:elapsed:from:", "Happy Birthday", 1.5], ["broadcast:", "message1"]]],
[10, 387, [["whenGreenFlag"], ["startScene", "Picture1"]]]],
"sounds": [{
"soundName": "pop",
"soundID": -1,
"md5": "83a9787d4cb6f3b7632b4ddfebf74367.wav",
"sampleCount": 258,
"rate": 11025,
"format": ""
},
{
"soundName": "C major ukulele",
"soundID": -1,
"md5": "aa2ca112507b59b5337f341aaa75fb08.wav",
"sampleCount": 18203,
"rate": 22050,
"format": ""
},
{
"soundName": "F major ukulele",
"soundID": -1,
"md5": "cd0ab5d1b0120c6ed92a1654ccf81376.wav",
"sampleCount": 18235,
"rate": 22050,
"format": ""
},
{
"soundName": "A minor ukulele",
"soundID": -1,
"md5": "69d25af0fd065da39c71439174efc589.wav",
"sampleCount": 18267,
"rate": 22050,
"format": ""
},
{
"soundName": "G ukulele",
"soundID": -1,
"md5": "d20218f92ee606277658959005538e2d.wav",
"sampleCount": 18235,
"rate": 22050,
"format": ""
},
{
"soundName": "crash cymbal",
"soundID": -1,
"md5": "f2c47a46f614f467a7ac802ed9ec3d8e.wav",
"sampleCount": 25220,
"rate": 22050,
"format": ""
}],
"costumes": [{
"costumeName": "costume1",
"baseLayerID": -1,
"baseLayerMD5": "6f9b37ef1092fd52e3711f4f91c3bffd.svg",
"bitmapResolution": 1,
"rotationCenterX": -5,
"rotationCenterY": 10
}],
"currentCostumeIndex": 0,
"scratchX": -132,
"scratchY": -73,
"scale": 1,
"direction": 90,
"rotationStyle": "normal",
"isDraggable": false,
"indexInLibrary": 2,
"visible": true,
"spriteInfo": {
}
},
{
"objName": "Sprite2",
"scripts": [[10,
75,
[["whenIReceive", "message1"], ["show"], ["say:duration:elapsed:from:", "to the most", 1.5], ["broadcast:", "message2"]]],
[10, 10, [["whenSceneStarts", "backdrop1"], ["hide"]]]],
"costumes": [{
"costumeName": "costume1",
"baseLayerID": -1,
"baseLayerMD5": "6f9b37ef1092fd52e3711f4f91c3bffd.svg",
"bitmapResolution": 1,
"rotationCenterX": -5,
"rotationCenterY": 10
}],
"currentCostumeIndex": 0,
"scratchX": -37,
"scratchY": -46,
"scale": 1,
"direction": 90,
"rotationStyle": "normal",
"isDraggable": false,
"indexInLibrary": 3,
"visible": true,
"spriteInfo": {
}
},
{
"objName": "Sprite4",
"scripts": [[10, 10, [["whenSceneStarts", "backdrop1"], ["hide"]]],
[10, 75, [["whenIReceive", "message3"], ["show"], ["say:duration:elapsed:from:", "Lifelong Kindergartner!", 1.5]]]],
"sounds": [{
"soundName": "pop",
"soundID": -1,
"md5": "83a9787d4cb6f3b7632b4ddfebf74367.wav",
"sampleCount": 258,
"rate": 11025,
"format": ""
}],
"costumes": [{
"costumeName": "costume1",
"baseLayerID": -1,
"baseLayerMD5": "6f9b37ef1092fd52e3711f4f91c3bffd.svg",
"bitmapResolution": 1,
"rotationCenterX": -5,
"rotationCenterY": 10
}],
"currentCostumeIndex": 0,
"scratchX": 201,
"scratchY": 49,
"scale": 1,
"direction": 90,
"rotationStyle": "normal",
"isDraggable": false,
"indexInLibrary": 5,
"visible": true,
"spriteInfo": {
}
},
{
"objName": "Sprite3",
"scripts": [[10,
75,
[["whenIReceive", "message2"], ["show"], ["say:duration:elapsed:from:", "wonderful", 1.5], ["broadcast:", "message3"]]],
[10, 10, [["whenSceneStarts", "backdrop1"], ["hide"]]]],
"sounds": [{
"soundName": "pop",
"soundID": -1,
"md5": "83a9787d4cb6f3b7632b4ddfebf74367.wav",
"sampleCount": 258,
"rate": 11025,
"format": ""
}],
"costumes": [{
"costumeName": "costume1",
"baseLayerID": -1,
"baseLayerMD5": "a49c3d21d027c3d31c978e20928d21c9.svg",
"bitmapResolution": 1,
"rotationCenterX": 1,
"rotationCenterY": 3
}],
"currentCostumeIndex": 0,
"scratchX": 43,
"scratchY": 22,
"scale": 1,
"direction": 90,
"rotationStyle": "normal",
"isDraggable": false,
"indexInLibrary": 4,
"visible": true,
"spriteInfo": {
}
},
{
"objName": "Sprite6",
"scripts": [[10, 10, [["whenGreenFlag"], ["hide"], ["gotoX:y:", -33, -180]]],
[10, 103, [["whenSceneStarts", "backdrop1"], ["show"], ["glideSecs:toX:y:elapsed:from:", 1, -33, 17]]]],
"sounds": [{
"soundName": "pop",
"soundID": -1,
"md5": "83a9787d4cb6f3b7632b4ddfebf74367.wav",
"sampleCount": 258,
"rate": 11025,
"format": ""
}],
"costumes": [{
"costumeName": "costume1",
"baseLayerID": -1,
"baseLayerMD5": "2293cf5e72baeed82e93d098092602b8.svg",
"bitmapResolution": 1,
"rotationCenterX": 77,
"rotationCenterY": -33
}],
"currentCostumeIndex": 0,
"scratchX": -33,
"scratchY": -127,
"scale": 1,
"direction": 90,
"rotationStyle": "normal",
"isDraggable": false,
"indexInLibrary": 8,
"visible": false,
"spriteInfo": {
}
},
{
"objName": "mitchchar",
"scripts": [[10, 10, [["whenGreenFlag"], ["hide"], ["gotoX:y:", -246, 20]]],
[10, 103, [["whenIReceive", "message5"], ["show"], ["glideSecs:toX:y:elapsed:from:", 2, -66, 48]]],
[195, 10, [["whenSceneStarts", "backdrop1"], ["gotoX:y:", -160, 8]]]],
"sounds": [{
"soundName": "pop",
"soundID": -1,
"md5": "83a9787d4cb6f3b7632b4ddfebf74367.wav",
"sampleCount": 258,
"rate": 11025,
"format": ""
}],
"costumes": [{
"costumeName": "mitchchar",
"baseLayerID": -1,
"baseLayerMD5": "090d89c842f21ac19676ba67195019a4.svg",
"bitmapResolution": 1,
"rotationCenterX": 61,
"rotationCenterY": 150
}],
"currentCostumeIndex": 0,
"scratchX": -246,
"scratchY": 20,
"scale": 0.85,
"direction": 90,
"rotationStyle": "normal",
"isDraggable": false,
"indexInLibrary": 1,
"visible": false,
"spriteInfo": {
}
},
{
"objName": "Sprite5",
"scripts": [[10, 10, [["whenGreenFlag"], ["hide"], ["gotoX:y:", 30, 180]]],
[10,
103,
[["whenSceneStarts", "backdrop1"],
["show"],
["glideSecs:toX:y:elapsed:from:", 1, 30, -16],
["doRepeat", 3, [["hide"], ["wait:elapsed:from:", 0.1], ["show"], ["wait:elapsed:from:", 0.1]]]]]],
"sounds": [{
"soundName": "pop",
"soundID": -1,
"md5": "83a9787d4cb6f3b7632b4ddfebf74367.wav",
"sampleCount": 258,
"rate": 11025,
"format": ""
}],
"costumes": [{
"costumeName": "costume1",
"baseLayerID": -1,
"baseLayerMD5": "730dcdcfe40ae025984d796f645db1d4.svg",
"bitmapResolution": 1,
"rotationCenterX": 147,
"rotationCenterY": 103
}],
"currentCostumeIndex": 0,
"scratchX": 30,
"scratchY": 144,
"scale": 1,
"direction": 90,
"rotationStyle": "normal",
"isDraggable": false,
"indexInLibrary": 7,
"visible": false,
"spriteInfo": {
}
}],
"info": {
"userAgent": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36",
"videoOn": false,
"projectID": "165661752",
"flashVersion": "MAC 25,0,0,171",
"scriptCount": 27,
"swfVersion": "v456",
"hasCloudData": false,
"spriteCount": 8
}
}