forked from paularmstrong/normalizr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.json
823 lines (823 loc) · 50.9 KB
/
output.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
{
"entities": {
"users": {
"14322": {
"login": "whistlerbrk",
"id": 14322,
"avatar_url": "https://avatars.githubusercontent.com/u/14322?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/whistlerbrk",
"html_url": "https://github.com/whistlerbrk",
"followers_url": "https://api.github.com/users/whistlerbrk/followers",
"following_url": "https://api.github.com/users/whistlerbrk/following{/other_user}",
"gists_url": "https://api.github.com/users/whistlerbrk/gists{/gist_id}",
"starred_url": "https://api.github.com/users/whistlerbrk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/whistlerbrk/subscriptions",
"organizations_url": "https://api.github.com/users/whistlerbrk/orgs",
"repos_url": "https://api.github.com/users/whistlerbrk/repos",
"events_url": "https://api.github.com/users/whistlerbrk/events{/privacy}",
"received_events_url": "https://api.github.com/users/whistlerbrk/received_events",
"type": "User",
"site_admin": false
},
"33297": {
"login": "paularmstrong",
"id": 33297,
"avatar_url": "https://avatars.githubusercontent.com/u/33297?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/paularmstrong",
"html_url": "https://github.com/paularmstrong",
"followers_url": "https://api.github.com/users/paularmstrong/followers",
"following_url": "https://api.github.com/users/paularmstrong/following{/other_user}",
"gists_url": "https://api.github.com/users/paularmstrong/gists{/gist_id}",
"starred_url": "https://api.github.com/users/paularmstrong/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/paularmstrong/subscriptions",
"organizations_url": "https://api.github.com/users/paularmstrong/orgs",
"repos_url": "https://api.github.com/users/paularmstrong/repos",
"events_url": "https://api.github.com/users/paularmstrong/events{/privacy}",
"received_events_url": "https://api.github.com/users/paularmstrong/received_events",
"type": "User",
"site_admin": false
},
"69485": {
"login": "unindented",
"id": 69485,
"avatar_url": "https://avatars.githubusercontent.com/u/69485?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/unindented",
"html_url": "https://github.com/unindented",
"followers_url": "https://api.github.com/users/unindented/followers",
"following_url": "https://api.github.com/users/unindented/following{/other_user}",
"gists_url": "https://api.github.com/users/unindented/gists{/gist_id}",
"starred_url": "https://api.github.com/users/unindented/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/unindented/subscriptions",
"organizations_url": "https://api.github.com/users/unindented/orgs",
"repos_url": "https://api.github.com/users/unindented/repos",
"events_url": "https://api.github.com/users/unindented/events{/privacy}",
"received_events_url": "https://api.github.com/users/unindented/received_events",
"type": "User",
"site_admin": false
},
"84749": {
"login": "pcompassion",
"id": 84749,
"avatar_url": "https://avatars.githubusercontent.com/u/84749?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/pcompassion",
"html_url": "https://github.com/pcompassion",
"followers_url": "https://api.github.com/users/pcompassion/followers",
"following_url": "https://api.github.com/users/pcompassion/following{/other_user}",
"gists_url": "https://api.github.com/users/pcompassion/gists{/gist_id}",
"starred_url": "https://api.github.com/users/pcompassion/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pcompassion/subscriptions",
"organizations_url": "https://api.github.com/users/pcompassion/orgs",
"repos_url": "https://api.github.com/users/pcompassion/repos",
"events_url": "https://api.github.com/users/pcompassion/events{/privacy}",
"received_events_url": "https://api.github.com/users/pcompassion/received_events",
"type": "User",
"site_admin": false
},
"655857": {
"login": "adjohu",
"id": 655857,
"avatar_url": "https://avatars.githubusercontent.com/u/655857?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/adjohu",
"html_url": "https://github.com/adjohu",
"followers_url": "https://api.github.com/users/adjohu/followers",
"following_url": "https://api.github.com/users/adjohu/following{/other_user}",
"gists_url": "https://api.github.com/users/adjohu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/adjohu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/adjohu/subscriptions",
"organizations_url": "https://api.github.com/users/adjohu/orgs",
"repos_url": "https://api.github.com/users/adjohu/repos",
"events_url": "https://api.github.com/users/adjohu/events{/privacy}",
"received_events_url": "https://api.github.com/users/adjohu/received_events",
"type": "User",
"site_admin": false
},
"853220": {
"login": "babsonmatt",
"id": 853220,
"avatar_url": "https://avatars.githubusercontent.com/u/853220?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/babsonmatt",
"html_url": "https://github.com/babsonmatt",
"followers_url": "https://api.github.com/users/babsonmatt/followers",
"following_url": "https://api.github.com/users/babsonmatt/following{/other_user}",
"gists_url": "https://api.github.com/users/babsonmatt/gists{/gist_id}",
"starred_url": "https://api.github.com/users/babsonmatt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/babsonmatt/subscriptions",
"organizations_url": "https://api.github.com/users/babsonmatt/orgs",
"repos_url": "https://api.github.com/users/babsonmatt/repos",
"events_url": "https://api.github.com/users/babsonmatt/events{/privacy}",
"received_events_url": "https://api.github.com/users/babsonmatt/received_events",
"type": "User",
"site_admin": false
},
"969003": {
"login": "YoruNoHikage",
"id": 969003,
"avatar_url": "https://avatars.githubusercontent.com/u/969003?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/YoruNoHikage",
"html_url": "https://github.com/YoruNoHikage",
"followers_url": "https://api.github.com/users/YoruNoHikage/followers",
"following_url": "https://api.github.com/users/YoruNoHikage/following{/other_user}",
"gists_url": "https://api.github.com/users/YoruNoHikage/gists{/gist_id}",
"starred_url": "https://api.github.com/users/YoruNoHikage/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/YoruNoHikage/subscriptions",
"organizations_url": "https://api.github.com/users/YoruNoHikage/orgs",
"repos_url": "https://api.github.com/users/YoruNoHikage/repos",
"events_url": "https://api.github.com/users/YoruNoHikage/events{/privacy}",
"received_events_url": "https://api.github.com/users/YoruNoHikage/received_events",
"type": "User",
"site_admin": false
},
"1499050": {
"login": "poyannabati",
"id": 1499050,
"avatar_url": "https://avatars.githubusercontent.com/u/1499050?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/poyannabati",
"html_url": "https://github.com/poyannabati",
"followers_url": "https://api.github.com/users/poyannabati/followers",
"following_url": "https://api.github.com/users/poyannabati/following{/other_user}",
"gists_url": "https://api.github.com/users/poyannabati/gists{/gist_id}",
"starred_url": "https://api.github.com/users/poyannabati/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/poyannabati/subscriptions",
"organizations_url": "https://api.github.com/users/poyannabati/orgs",
"repos_url": "https://api.github.com/users/poyannabati/repos",
"events_url": "https://api.github.com/users/poyannabati/events{/privacy}",
"received_events_url": "https://api.github.com/users/poyannabati/received_events",
"type": "User",
"site_admin": false
},
"1591483": {
"login": "arb",
"id": 1591483,
"avatar_url": "https://avatars.githubusercontent.com/u/1591483?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/arb",
"html_url": "https://github.com/arb",
"followers_url": "https://api.github.com/users/arb/followers",
"following_url": "https://api.github.com/users/arb/following{/other_user}",
"gists_url": "https://api.github.com/users/arb/gists{/gist_id}",
"starred_url": "https://api.github.com/users/arb/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/arb/subscriptions",
"organizations_url": "https://api.github.com/users/arb/orgs",
"repos_url": "https://api.github.com/users/arb/repos",
"events_url": "https://api.github.com/users/arb/events{/privacy}",
"received_events_url": "https://api.github.com/users/arb/received_events",
"type": "User",
"site_admin": false
},
"1690457": {
"login": "TryingToImprove",
"id": 1690457,
"avatar_url": "https://avatars.githubusercontent.com/u/1690457?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/TryingToImprove",
"html_url": "https://github.com/TryingToImprove",
"followers_url": "https://api.github.com/users/TryingToImprove/followers",
"following_url": "https://api.github.com/users/TryingToImprove/following{/other_user}",
"gists_url": "https://api.github.com/users/TryingToImprove/gists{/gist_id}",
"starred_url": "https://api.github.com/users/TryingToImprove/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/TryingToImprove/subscriptions",
"organizations_url": "https://api.github.com/users/TryingToImprove/orgs",
"repos_url": "https://api.github.com/users/TryingToImprove/repos",
"events_url": "https://api.github.com/users/TryingToImprove/events{/privacy}",
"received_events_url": "https://api.github.com/users/TryingToImprove/received_events",
"type": "User",
"site_admin": false
},
"5119347": {
"login": "lqzerogg",
"id": 5119347,
"avatar_url": "https://avatars.githubusercontent.com/u/5119347?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/lqzerogg",
"html_url": "https://github.com/lqzerogg",
"followers_url": "https://api.github.com/users/lqzerogg/followers",
"following_url": "https://api.github.com/users/lqzerogg/following{/other_user}",
"gists_url": "https://api.github.com/users/lqzerogg/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lqzerogg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lqzerogg/subscriptions",
"organizations_url": "https://api.github.com/users/lqzerogg/orgs",
"repos_url": "https://api.github.com/users/lqzerogg/repos",
"events_url": "https://api.github.com/users/lqzerogg/events{/privacy}",
"received_events_url": "https://api.github.com/users/lqzerogg/received_events",
"type": "User",
"site_admin": false
},
"6775919": {
"login": "BerkeleyTrue",
"id": 6775919,
"avatar_url": "https://avatars.githubusercontent.com/u/6775919?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/BerkeleyTrue",
"html_url": "https://github.com/BerkeleyTrue",
"followers_url": "https://api.github.com/users/BerkeleyTrue/followers",
"following_url": "https://api.github.com/users/BerkeleyTrue/following{/other_user}",
"gists_url": "https://api.github.com/users/BerkeleyTrue/gists{/gist_id}",
"starred_url": "https://api.github.com/users/BerkeleyTrue/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/BerkeleyTrue/subscriptions",
"organizations_url": "https://api.github.com/users/BerkeleyTrue/orgs",
"repos_url": "https://api.github.com/users/BerkeleyTrue/repos",
"events_url": "https://api.github.com/users/BerkeleyTrue/events{/privacy}",
"received_events_url": "https://api.github.com/users/BerkeleyTrue/received_events",
"type": "User",
"site_admin": false
},
"14313723": {
"login": "vimalceg",
"id": 14313723,
"avatar_url": "https://avatars.githubusercontent.com/u/14313723?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/vimalceg",
"html_url": "https://github.com/vimalceg",
"followers_url": "https://api.github.com/users/vimalceg/followers",
"following_url": "https://api.github.com/users/vimalceg/following{/other_user}",
"gists_url": "https://api.github.com/users/vimalceg/gists{/gist_id}",
"starred_url": "https://api.github.com/users/vimalceg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vimalceg/subscriptions",
"organizations_url": "https://api.github.com/users/vimalceg/orgs",
"repos_url": "https://api.github.com/users/vimalceg/repos",
"events_url": "https://api.github.com/users/vimalceg/events{/privacy}",
"received_events_url": "https://api.github.com/users/vimalceg/received_events",
"type": "User",
"site_admin": false
}
},
"labels": {
"undefined": {
"0": {
"id": 373884166,
"url": "https://api.github.com/repos/paularmstrong/normalizr/labels/Priority:%20Low",
"name": "Priority: Low",
"color": "009800",
"default": false
},
"1": {
"id": 373884281,
"url": "https://api.github.com/repos/paularmstrong/normalizr/labels/Status:%20Accepted",
"name": "Status: Accepted",
"color": "009800",
"default": false
},
"2": {
"id": 373884447,
"url": "https://api.github.com/repos/paularmstrong/normalizr/labels/Type:%20Bug",
"name": "Type: Bug",
"color": "e11d21",
"default": false
},
"3": {
"id": 373884449,
"url": "https://api.github.com/repos/paularmstrong/normalizr/labels/Type:%20Question",
"name": "Type: Question",
"color": "cc317c",
"default": false
}
}
},
"milestones": {
"1883567": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/milestones/2",
"html_url": "https://github.com/paularmstrong/normalizr/milestone/2",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/milestones/2/labels",
"id": 1883567,
"number": 2,
"title": "2.3.0",
"description": "",
"creator": 33297,
"open_issues": 2,
"closed_issues": 1,
"state": "closed",
"created_at": "2016-07-14T15:24:52Z",
"updated_at": "2016-12-21T21:54:06Z",
"due_on": "2016-08-20T07:00:00Z",
"closed_at": "2016-12-19T19:32:20Z"
},
"2205635": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/milestones/3",
"html_url": "https://github.com/paularmstrong/normalizr/milestone/3",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/milestones/3/labels",
"id": 2205635,
"number": 3,
"title": "3.0.0",
"description": "Fully re-written, simpler, faster, more extendable.",
"creator": 33297,
"open_issues": 3,
"closed_issues": 0,
"state": "open",
"created_at": "2016-12-19T19:32:16Z",
"updated_at": "2016-12-21T15:42:53Z",
"due_on": "2017-01-03T08:00:00Z",
"closed_at": null
}
},
"issues": {
"127301608": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/54",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/54/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/54/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/54/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/54",
"id": 127301608,
"number": 54,
"title": "Should empty arrays be preserved on their entity?",
"user": 853220,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 5,
"created_at": "2016-01-18T20:07:54Z",
"updated_at": "2016-05-24T14:00:18Z",
"closed_at": null,
"body": "{ id: 1, name: 'test', tags: [] } normalizes as { id: 1, name: 'test' }\n\nWould it make sense to preserve the empty array or at least allow the option to do so?\n"
},
"134547187": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/68",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/68/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/68/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/68/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/68",
"id": 134547187,
"number": 68,
"title": "Dealing with collections keyed by ID without an ID in the entity itself",
"user": 655857,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 4,
"created_at": "2016-02-18T11:02:18Z",
"updated_at": "2016-05-24T13:59:36Z",
"closed_at": null,
"body": "Is there any way I can deal with data in the following format?\n\n```\n{\n 1: {\n name: 'test user'\n }\n}\n```\n\nAs far as I can tell, I can only work with objects that themselves contain an id i.e.\n\n```\n{\n name: 'test user',\n id: 1\n}\n```\n"
},
"134935104": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/70",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/70/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/70/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/70/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/70",
"id": 134935104,
"number": 70,
"title": "Keep consistency for relations",
"user": 969003,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 9,
"created_at": "2016-02-19T18:10:17Z",
"updated_at": "2016-05-24T13:45:14Z",
"closed_at": null,
"body": "I think it would be great to have consistency in relationship between entities when normalized.\nHere's an example : \n\nConsider you have two entities **user** and **project**. You define the relations like this (bidirectional) : \n\n``` js\nuserSchema.define({\n projects: arrayOf(projectSchema),\n})\n\nprojectSchema.define({\n contributors: arrayOf(userSchema),\n})\n```\n\nNow you want to create a project, you send some request to a server that replies with the project entity like this : \n\n``` js\n{\n id: 80,\n contributors: [1], // your userId for example\n // other fields\n}\n```\n\nYou normalize the response and merge with the rest of your entities (just like the real-world example for Redux), the projects' entities are updated but not the user.\n\nSo my proposal is to add a capability of telling what is the property in the foreign object and instead of normalizing like this : \n\n``` js\n{\n entities: {\n projects: {\n 80: {\n id: 80,\n contributors: [1],\n // other fields\n }\n }\n }\n}\n```\n\nI'm proposing something like this : \n\n``` js\n{\n entities: {\n projects: {\n 80: {\n id: 80,\n contributors: [1],\n // other fields\n }\n },\n users: {\n 1: {\n id: 1,\n projects: [80]\n }\n }\n }\n}\n```\n\nWe could do something like this : \n\n``` js\nuserSchema.define({\n projects: arrayOf(projectSchema).mappedBy('contributors'),\n})\n\nprojectSchema.define({\n contributors: arrayOf(userSchema).mappedBy('projects'),\n})\n```\n\nThis prevent any flaws in consistency while being simple (user side). I already tried a solution, it's not bulletproof but I can submit a cleaner PR if you're interested.\n"
},
"154328039": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/105",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/105/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/105/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/105/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/105",
"id": 154328039,
"number": 105,
"title": "Update & Organize Documentation",
"user": 33297,
"state": "open",
"locked": false,
"assignee": 33297,
"assignees": [
33297
],
"milestone": 1883567,
"comments": 0,
"created_at": "2016-05-11T19:52:34Z",
"updated_at": "2016-07-14T15:24:58Z",
"closed_at": null,
"body": ""
},
"154328158": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/106",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/106/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/106/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/106/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/106",
"id": 154328158,
"number": 106,
"title": "Clean up tests",
"user": 33297,
"state": "open",
"locked": false,
"assignee": 33297,
"assignees": [
33297
],
"milestone": 1883567,
"comments": 0,
"created_at": "2016-05-11T19:53:07Z",
"updated_at": "2016-07-14T15:25:19Z",
"closed_at": null,
"body": "Currently hard to read through. Should be better organized and easier to maintain.\n"
},
"161111737": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/126",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/126/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/126/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/126/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/126",
"id": 161111737,
"number": 126,
"title": "normalize is take some time if object has more number of keys.",
"user": 14313723,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 3,
"created_at": "2016-06-20T03:41:07Z",
"updated_at": "2016-07-05T22:55:19Z",
"closed_at": null,
"body": "# Problem\n\nnormalization is take some time if object has more number of keys. I tried with array has 100 object and each object has 30 keys and mapping with two nested schema. It takes around ~25ms. I tried using schema based iteration it takes ~7ms. I don't know, Is any problem using schema based iteration? Please refer the link below.\n\nhttps://github.com/vimalceg/normalizr\n"
},
"178773735": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/154",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/154/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/154/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/154/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/154",
"id": 178773735,
"number": 154,
"title": "Will arrayOf support a parameter that not a schema?",
"user": 5119347,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 2,
"created_at": "2016-09-23T03:05:59Z",
"updated_at": "2016-09-27T01:58:49Z",
"closed_at": null,
"body": "# Problem\n\nAfter normalizr process, I want something like this\n\n```\n{result: [{a: 'xxx', b: 'xxx', c: 'ccc'}]}\n```\n\nBut I don't want to defined a schema like:\n\n```\nconst dSchema = new Schema('d')\ndSchema.define({a: aSchema, b: bSchema, c: cSchema})\n```\n\nIs there any way to achieve this? If there is, please tell me. If not, will it possible to support it?\nI do feel sick of defining an extra schema.\n\n**Input**\n\n```\nlet input = [{a: {id: 'aid', name: 'object a'}, b: {id: 'bid', name: 'object b'}]\n```\n\n**schema**\n\n```\nconst aSchema = new Schema('as');\nconst bSchema = new Schema('bs');\nnormalize(input, arrayOf({a: aSchema, b: bSchema}));\n```\n\n**Output**\n\nHere's what I expect to see when I run the above:\n\n```\n{\n result: [{a: 'aid', b: 'bid'}],\n entities: {\n as: { aid: {id: 'aid', name: 'object a'}}\n bs: { bid: {id: 'bid', name: 'object b'}}\n }\n}\n```\n"
},
"186469900": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/165",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/165/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/165/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/165/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/165",
"id": 186469900,
"number": 165,
"title": "Django rest framework and normalizr ",
"user": 84749,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 2,
"created_at": "2016-11-01T06:46:33Z",
"updated_at": "2016-11-02T06:30:40Z",
"closed_at": null,
"body": "For a following schema (expressed in django models)\r\n\r\n class A:\r\n b = foreigneKey(B)\r\n \r\n \r\n class B:\r\n pass\r\n\r\nDjango rest framework serializes A instance as\r\n\r\n { \r\n 'id': 1,\r\n 'b': 3\r\n }\r\n\r\n\r\nnormalizr seems to want a format of\r\n\r\n {\r\n 'id': 1,\r\n 'b': {\r\n 'id': 3\r\n }\r\n }\r\n\r\n\r\nI could change DRF 's default PrimaryKeyRelatedField's serialization, but I 'm wondering if there's another way? \r\nMaybe there's a way to tell normalizr that 'b' is itself an id attribute?\r\n\r\n"
},
"188006036": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/172",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/172/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/172/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/172/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/172",
"id": 188006036,
"number": 172,
"title": "Set field on child entity based on parent entity on normalization",
"user": 1499050,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 2,
"created_at": "2016-11-08T14:29:51Z",
"updated_at": "2016-12-21T15:02:10Z",
"closed_at": null,
"body": "# Problem\r\n\r\nIs there anyway to set a field on the child entity based on the parent entity? I.e, if we have\r\n\r\n```\r\n[{\r\n id: 1,\r\n title: 'Some Article',\r\n comment: {\r\n id: 109,\r\n content: 'Hai'\r\n }\r\n}, {\r\n id: 2,\r\n title: 'Other Article',\r\n comment: {\r\n id: 110,\r\n content: 'Gee'\r\n }\r\n}]\r\n```\r\n\r\nCan we somehow get \r\n\r\n```\r\n{\r\n result: [1, 2],\r\n entities: {\r\n articles: {\r\n 1: {\r\n id: 1,\r\n title: 'Some Article',\r\n comments: [109]\r\n },\r\n 2: {\r\n id: 2,\r\n title: 'Other Article',\r\n comments: [110]\r\n }\r\n },\r\n comments: {\r\n 109: {\r\n id: 109,\r\n content: 'Hai'\r\n article: 1,\r\n },\r\n 110: {\r\n id: 110,\r\n content: 'Gee'\r\n article: 2,\r\n }\r\n }\r\n }\r\n}\r\n```\r\n?\r\n\r\nWould this be a desirable feature otherwise? "
},
"191124603": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/176",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/176/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/176/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/176/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/176",
"id": 191124603,
"number": 176,
"title": "bizarre uncaught reference when attempting import of normalizr",
"user": 14322,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 3,
"created_at": "2016-11-22T21:08:09Z",
"updated_at": "2016-11-28T10:11:54Z",
"closed_at": null,
"body": "# Problem\r\n\r\nI have a perfectly working Redux app being served out via Express, I'm using webpack which I suspect may be the problem.\r\n\r\n**Input**\r\n\r\nHere's how I'm using normalizr, in schema.js\r\n\r\n```js\r\nimport { Schema, arrayOf, valuesOf } from 'normalizr';\r\n\r\nconst uploadSchema = new Schema('uploads');\r\nconst sheetSchema = new Schema('sheets');\r\nconst mappingSchema = new Schema('mappings');\r\nconst tableSchema = new Schema('tables');\r\nconst rowSchema = new Schema('rows');\r\n\r\nuploadSchema.define({\r\n sheets: valuesOf(sheetSchema)\r\n})\r\n\r\nsheetSchema.define({\r\n mapping: mappingSchema,\r\n rows: {\r\n collection: arrayOf(tableSchema)\r\n }\r\n})\r\n\r\nexport { uploadSchema, sheetSchema, mappingSchema, tableSchema, rowSchema }\r\n```\r\n\r\nand in a utility file I have for abstracting out my ajax calls via `whatwg-fetch`:\r\n\r\n```js\r\nimport { normalize } from 'normalizr';\r\nimport {uploadSchema, sheetSchema, mappingSchema, tableSchema, rowSchema} from \"./schema\";\r\nimport 'whatwg-fetch';\r\n\r\n... some functions ...\r\n\r\nfunction handleRequestAndResponse(url, request) {\r\n console.log(\"request:\");\r\n console.log(request);\r\n\r\n return fetch(url, request)\r\n .then(function (resp) {\r\n // check status and throw if unexpected...\r\n if (resp.status >= 200 && resp.status < 400) {\r\n return resp\r\n } else {\r\n\r\n console.log(\"uncaught error, but we will format a response from it...\")\r\n console.log(resp)\r\n\r\n var errorResponse = new Error(resp.statusText)\r\n errorResponse.error = true\r\n errorResponse.status = resp.status;\r\n errorResponse.url = resp.url;\r\n errorResponse.body = resp.body;\r\n\r\n throw errorResponse\r\n }\r\n }).then(function (resp) {\r\n // parse JSON\r\n return resp.json();\r\n }).then(function (resp) {\r\n // log and return\r\n console.log(\"response:\");\r\n console.log(resp);\r\n\r\n // boom, here, normalize is an uncaught ref, and if I insert a debugger anywhere else in this file, the same\r\n debugger\r\n\r\n return resp;\r\n }).catch(function(errorResp) {\r\n return errorResp;\r\n });\r\n}\r\n```\r\n\r\nI suspected TypeScript involvement and tried to remedy with ts-loader, no dice.\r\n\r\nI tried directly importing normalizr without success:\r\n\r\n`import 'normalizr'`\r\n\r\nI've tried adjusting my webpack in the endless esoteric ways it requires to no avail.\r\n\r\nI've tried directly importing functions from normalizr.min.js in the dist folder, also to no avail.\r\n\r\nMy webpack:\r\n\r\n```\r\nvar path = require('path');\r\nvar webpack = require('webpack');\r\n\r\nmodule.exports = {\r\n devtool: 'eval-source-map',\r\n entry:\r\n [\r\n 'whatwg-fetch',\r\n 'webpack-hot-middleware/client',\r\n './client/inventory-app'\r\n ]\r\n ,\r\n output: {\r\n path: path.join(__dirname, 'dist'),\r\n filename: 'bundle.js',\r\n publicPath: '/static/'\r\n },\r\n plugins: [\r\n new webpack.HotModuleReplacementPlugin(),\r\n new webpack.NoErrorsPlugin()\r\n ],\r\n resolve: {\r\n alias: {\r\n webworkify: 'webworkify-webpack'\r\n },\r\n extensions: ['', '.scss', '.css', '.js', '.json', '.ts'],\r\n modulesDirectories: [\r\n 'node_modules',\r\n path.resolve(__dirname, './node_modules')\r\n ]\r\n },\r\n module: {\r\n loaders: [\r\n {\r\n test: /\\.css$/,\r\n loader:'style!css!'\r\n },\r\n { test: /\\.tsx?$/, loader: \"ts-loader\" },\r\n {\r\n test: /\\.js$/,\r\n loaders: ['babel'],\r\n // loaders: ['babel?presets[]=es2015,presets[]=stage-0,presets[]=react,plugins[]=transform-runtime'],\r\n exclude: /node_modules/,\r\n include: path.join(__dirname, 'client')\r\n },\r\n {\r\n test: /\\.json$/,\r\n loader: 'json-loader'\r\n }\r\n ]\r\n }\r\n};\r\n```\r\n\r\nNote that the typescript stuff was added by me most recently and didn't help.\r\n\r\nAlso note that when in my schema.js when I insert a debugger statement below the const definitions, my consts *are* defined, but if I try to \"var foo = new Schema('foo')\" I'll get a reference error again.\r\n\r\nI'm at a loss. I hope this isn't my poor understanding of webpack, but this has only happened with this integration so I'm opening an issue after not finding success looking around on the web / asking in Reactiflux.\r\n\r\n\r\n\r\n"
},
"196525159": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/185",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/185/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/185/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/185/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/185",
"id": 196525159,
"number": 185,
"title": "Request: Add a changelog",
"user": 6775919,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 1,
"created_at": "2016-12-19T21:29:14Z",
"updated_at": "2016-12-19T21:40:26Z",
"closed_at": null,
"body": "I'm attempting to debug in a breaking change introduced in 2.3\r\n\r\nMy first step is usually to run through the changelog, but to my surprise there is none to be found (At least to my eyes, but I have been known to miss things).\r\n\r\nAlso, want to say thanks for such an awesome project!"
},
"196531836": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/186",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/186/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/186/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/186/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/186",
"id": 196531836,
"number": 186,
"title": "results for arrayOf returns array instead of map as of version 2.3.0",
"user": 6775919,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 0,
"created_at": "2016-12-19T22:01:30Z",
"updated_at": "2016-12-19T22:10:31Z",
"closed_at": null,
"body": "# Problem\r\n\r\nUpgrading to 2.3.0 introduces a breaking change to the way `results` are returned.\r\n\r\nIt looks like results are now normalized when both values are the same. https://github.com/paularmstrong/normalizr/blob/master/src/index.js#L116\r\n\r\nThis is a breaking change and should result in a major bump and a warning to those who expect a keyed map in return regardless of the values of that map.\r\n\r\n**Input**\r\n\r\nHere's how I'm using normalizr:\r\n\r\n```js\r\nconst challenge = new Schema('challenge', { idAttribute: 'dashedName' });\r\nconst block = new Schema('block', { idAttribute: 'dashedName' });\r\nconst superBlock = new Schema('superBlock', { idAttribute: 'dashedName' });\r\n\r\nblock.define({\r\n challenges: arrayOf(challenge)\r\n});\r\n\r\nsuperBlock.define({\r\n blocks: arrayOf(block)\r\n});\r\n\r\nconst mapSchema = valuesOf(superBlock);\r\nconst map = {\r\n 'getting-started': {\r\n dashedName: 'getting-started',\r\n blocks: [\r\n {\r\n dashedName: 'some-block',\r\n challenges: [{\r\n dashedName: 'some-challenge',\r\n ...\r\n },\r\n ...\r\n ],\r\n ...\r\n },\r\n ...\r\n ],\r\n ...\r\n },\r\n ...\r\n};\r\nnormalize(map, mapSchema);\r\n```\r\n\r\n**Output**\r\nHere is what has been the output up to 2.2.1\r\n```js\r\n {\r\n result: {\r\n 'getting-started': 'getting-started',\r\n 'front-end-development-certification': 'front-end-development-certification',\r\n 'data-visualization-certification': 'data-visualization-certification',\r\n 'back-end-development-certification': 'back-end-development-certification',\r\n 'video-challenges': 'video-challenges',\r\n 'full-stack-development-certification': 'full-stack-development-certification',\r\n 'coding-interview-preparation': 'coding-interview-preparation'\r\n},\r\n entities: { ... }\r\n}\r\n```\r\n\r\nHere is what I actually as of 2.3.0\r\n\r\n\r\n```js\r\n{\r\n result: [ [ \r\n 'getting-started',\r\n 'front-end-development-certification',\r\n 'data-visualization-certification',\r\n 'back-end-development-certification',\r\n 'video-challenges',\r\n 'full-stack-development-certification',\r\n 'coding-interview-preparation'\r\n ],\r\n entities: { ...}\r\n}\r\n```\r\n"
},
"196954427": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/187",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/187/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/187/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/187/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/187",
"id": 196954427,
"number": 187,
"title": "v3 Docs",
"user": 33297,
"state": "open",
"locked": false,
"assignee": 33297,
"assignees": [
33297
],
"milestone": 2205635,
"comments": 0,
"created_at": "2016-12-21T15:04:39Z",
"updated_at": "2016-12-21T21:53:28Z",
"closed_at": null,
"body": "# Problem\r\n\r\nDocumentation in <= 2.x has been a bit difficult to follow, with lots of really long examples in a single README.\r\n\r\n# Solution\r\n\r\nFor v3, create a `/docs` folder and separate out meaningful documentation by section/page, with shorter, easier to follow examples."
},
"196954928": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/188",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/188/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/188/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/188/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/188",
"id": 196954928,
"number": 188,
"title": "Add In-Repo Examples",
"user": 33297,
"state": "open",
"locked": false,
"assignee": 33297,
"assignees": [
33297
],
"milestone": 2205635,
"comments": 0,
"created_at": "2016-12-21T15:06:29Z",
"updated_at": "2016-12-21T21:53:28Z",
"closed_at": null,
"body": "# Problem\r\n\r\nExamples are currently somewhere untracked by this project. They have moved or been lost in the past.\r\n\r\n# Solution\r\n\r\nAdd an `/examples` folder with clear and concise usage patterns."
},
"196963939": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/189",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/189/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/189/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/189/events",
"html_url": "https://github.com/paularmstrong/normalizr/issues/189",
"id": 196963939,
"number": 189,
"title": "Wanted: Typescript definitions & tests for v3.0.0",
"user": 33297,
"state": "open",
"locked": false,
"assignee": 69485,
"assignees": [
69485
],
"milestone": 2205635,
"comments": 2,
"created_at": "2016-12-21T15:42:53Z",
"updated_at": "2016-12-22T14:57:41Z",
"closed_at": null,
"body": "# Problem\r\n\r\n@paularmstrong doesn't know typescript and is too lazy to learn\r\n\r\n# Solution\r\n\r\nTry to get someone from the community donate a little time adding a typescript definition file and tests for the [v3.0.0 branch](https://github.com/paularmstrong/normalizr/tree/master) before launch"
}
},
"pullRequests": {
"165986889": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/135",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/135/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/135/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/135/events",
"html_url": "https://github.com/paularmstrong/normalizr/pull/135",
"id": 165986889,
"number": 135,
"title": "It should be possible to use relations",
"user": 1690457,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 1,
"created_at": "2016-07-17T17:38:38Z",
"updated_at": "2016-09-25T15:15:05Z",
"closed_at": null,
"pull_request": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/pulls/135",
"html_url": "https://github.com/paularmstrong/normalizr/pull/135",
"diff_url": "https://github.com/paularmstrong/normalizr/pull/135.diff",
"patch_url": "https://github.com/paularmstrong/normalizr/pull/135.patch"
},
"body": "# Problem\n\nSome objects have arrays with objects, which does not have a identifier, and is\ntightly coupled to the parent object.\n\nI created a issue here: #134\n# Solution\n\nIt should possible to mark those objects as a relation to the parent object\nand use the parent object id as the identifier when normalizing\n# TODO\n- [x] Add & Update Tests\n### Use case\n\nSee updated test\n"
},
"183956234": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/161",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/161/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/161/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/161/events",
"html_url": "https://github.com/paularmstrong/normalizr/pull/161",
"id": 183956234,
"number": 161,
"title": "Pass parent object to idAttribute.",
"user": 1591483,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 9,
"created_at": "2016-10-19T13:06:03Z",
"updated_at": "2016-11-29T18:51:34Z",
"closed_at": null,
"pull_request": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/pulls/161",
"html_url": "https://github.com/paularmstrong/normalizr/pull/161",
"diff_url": "https://github.com/paularmstrong/normalizr/pull/161.diff",
"patch_url": "https://github.com/paularmstrong/normalizr/pull/161.patch"
},
"body": "# Problem\n\nProvide a mechanism to use a parent object data in generating entity id.\n# Solution\n\nPass the `last` object through all of the traversal methods and make sure it gets passed specifically to `visitEntity` as that is where `getId` is called and pass the parent object into that function. \n\nCloses #160\n"
},
"188066564": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/issues/173",
"repository_url": "https://api.github.com/repos/paularmstrong/normalizr",
"labels_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/173/labels{/name}",
"comments_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/173/comments",
"events_url": "https://api.github.com/repos/paularmstrong/normalizr/issues/173/events",
"html_url": "https://github.com/paularmstrong/normalizr/pull/173",
"id": 188066564,
"number": 173,
"title": "Added schema option for assigning the parent id on the child entity",
"user": 1499050,
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 2,
"created_at": "2016-11-08T18:22:42Z",
"updated_at": "2016-12-21T15:00:24Z",
"closed_at": null,
"pull_request": {
"url": "https://api.github.com/repos/paularmstrong/normalizr/pulls/173",
"html_url": "https://github.com/paularmstrong/normalizr/pull/173",
"diff_url": "https://github.com/paularmstrong/normalizr/pull/173.diff",
"patch_url": "https://github.com/paularmstrong/normalizr/pull/173.patch"
},
"body": "# Problem\r\n\r\nCloses #172. Partially inspired by #135. \r\n\r\nBasically, we sometimes when normalizing, we would like to set the parent id on the child as well as setting the child ids on the parent. \r\n\r\nExample;\r\n\r\n```\r\n// INPUT \r\n\r\n[{\r\n id: 1,\r\n title: 'Some Article',\r\n comment: {\r\n id: 109,\r\n content: 'Hai'\r\n }\r\n}, {\r\n id: 2,\r\n title: 'Other Article',\r\n comment: {\r\n id: 110,\r\n content: 'Gee'\r\n }\r\n}]\r\n\r\n// OUTPUT\r\n\r\n{\r\n result: [1, 2],\r\n entities: {\r\n articles: {\r\n 1: {\r\n id: 1,\r\n title: 'Some Article',\r\n comments: [109]\r\n },\r\n 2: {\r\n id: 2,\r\n title: 'Other Article',\r\n comments: [110]\r\n }\r\n },\r\n comments: {\r\n 109: {\r\n id: 109,\r\n content: 'Hai'\r\n article: 1,\r\n },\r\n 110: {\r\n id: 110,\r\n content: 'Gee'\r\n article: 2,\r\n }\r\n }\r\n }\r\n}\r\n```\r\n\r\n# Solution\r\n\r\nWhen defining the schema, you can set assignParentId to true and this will result in the child entity getting the parent object's id set. \r\n\r\n# TODO\r\n- [ ] Didn't cover the UnionSchema case. Let me know if that is a requirement to proceed. \r\n- [x] Add & Update Tests\r\n\r\n"
}
}
},
"result": [
{
"id": 196963939,
"schema": "issues"
},
{
"id": 196954928,
"schema": "issues"
},
{
"id": 196954427,
"schema": "issues"
},
{
"id": 196531836,
"schema": "issues"
},
{
"id": 196525159,
"schema": "issues"
},
{
"id": 191124603,
"schema": "issues"
},
{
"id": 188066564,
"schema": "pullRequests"
},
{
"id": 188006036,
"schema": "issues"
},
{
"id": 186469900,
"schema": "issues"
},
{
"id": 183956234,
"schema": "pullRequests"
},
{
"id": 178773735,
"schema": "issues"
},
{
"id": 165986889,
"schema": "pullRequests"
},
{
"id": 161111737,
"schema": "issues"
},
{
"id": 154328158,
"schema": "issues"
},
{
"id": 154328039,
"schema": "issues"
},
{
"id": 134935104,
"schema": "issues"
},
{
"id": 134547187,
"schema": "issues"
},
{
"id": 127301608,
"schema": "issues"
}
]
}