sparsam 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/spec/gen-ruby/user_types.rb +552 -49
- data/spec/sparsam_spec.rb +17 -0
- data/spec/user.thrift +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 418d5b778804d87629bffaa38ae70420ce0c1d54
|
4
|
+
data.tar.gz: 97e472841bbf213dfad5e161228bdea9ec2e2baa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 823b230987338ee70f778a1c1dd92818acf6d1719175ae0f365b3514eb0ebcdb203993442b9688b1e3e63fc81ddc809d6ce51747b23f46d3c5b62818e2a0ef86
|
7
|
+
data.tar.gz: f11c539cedebcad0ac100fa27a0cd267f2b50b97d652800537413ba13009d4bf723c872874c6c43f0d77fcdf609ac8ec340caf091c0855735f76fd1f0fb8a6b8
|
data/spec/gen-ruby/user_types.rb
CHANGED
@@ -18,10 +18,45 @@ end
|
|
18
18
|
|
19
19
|
class US < ::Sparsam::Struct
|
20
20
|
FIELDS = {
|
21
|
-
1 => {
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
1 => {
|
22
|
+
:type => ::Sparsam::Types::I32,
|
23
|
+
:name => 'id_i32',
|
24
|
+
:optional => true,
|
25
|
+
:annotations => {
|
26
|
+
},
|
27
|
+
},
|
28
|
+
2 => {
|
29
|
+
:type => ::Sparsam::Types::STRING,
|
30
|
+
:name => 'id_s',
|
31
|
+
:default => %q"id_s default",
|
32
|
+
:binary => true,
|
33
|
+
:optional => true,
|
34
|
+
:annotations => {
|
35
|
+
},
|
36
|
+
},
|
37
|
+
3 => {
|
38
|
+
:type => ::Sparsam::Types::SET,
|
39
|
+
:name => 'string_set',
|
40
|
+
:element => {
|
41
|
+
:type => ::Sparsam::Types::STRING,
|
42
|
+
},
|
43
|
+
:optional => true,
|
44
|
+
:annotations => {
|
45
|
+
},
|
46
|
+
},
|
47
|
+
4 => {
|
48
|
+
:type => ::Sparsam::Types::SET,
|
49
|
+
:name => 'int_set',
|
50
|
+
:element => {
|
51
|
+
:type => ::Sparsam::Types::I32,
|
52
|
+
},
|
53
|
+
:optional => true,
|
54
|
+
:annotations => {
|
55
|
+
},
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
ANNOTATIONS = {
|
25
60
|
}
|
26
61
|
|
27
62
|
init_thrift_struct(self)
|
@@ -29,8 +64,23 @@ end
|
|
29
64
|
|
30
65
|
class UN < ::Sparsam::Union
|
31
66
|
FIELDS = {
|
32
|
-
1 => {
|
33
|
-
|
67
|
+
1 => {
|
68
|
+
:type => ::Sparsam::Types::I32,
|
69
|
+
:name => 'id_i32',
|
70
|
+
:optional => true,
|
71
|
+
:annotations => {
|
72
|
+
},
|
73
|
+
},
|
74
|
+
2 => {
|
75
|
+
:type => ::Sparsam::Types::STRING,
|
76
|
+
:name => 'id_s',
|
77
|
+
:optional => true,
|
78
|
+
:annotations => {
|
79
|
+
},
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
ANNOTATIONS = {
|
34
84
|
}
|
35
85
|
|
36
86
|
init_thrift_struct(self)
|
@@ -38,16 +88,107 @@ end
|
|
38
88
|
|
39
89
|
class SS < ::Sparsam::Struct
|
40
90
|
FIELDS = {
|
41
|
-
1 => {
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
91
|
+
1 => {
|
92
|
+
:type => ::Sparsam::Types::I32,
|
93
|
+
:name => 'id_i32',
|
94
|
+
:optional => true,
|
95
|
+
:annotations => {
|
96
|
+
},
|
97
|
+
},
|
98
|
+
2 => {
|
99
|
+
:type => ::Sparsam::Types::STRING,
|
100
|
+
:name => 'id_s',
|
101
|
+
:optional => true,
|
102
|
+
:annotations => {
|
103
|
+
},
|
104
|
+
},
|
105
|
+
3 => {
|
106
|
+
:type => ::Sparsam::Types::STRUCT,
|
107
|
+
:name => 'us_i',
|
108
|
+
:class => ::US,
|
109
|
+
:optional => true,
|
110
|
+
:annotations => {
|
111
|
+
},
|
112
|
+
},
|
113
|
+
4 => {
|
114
|
+
:type => ::Sparsam::Types::SET,
|
115
|
+
:name => 'us_s',
|
116
|
+
:element => {
|
117
|
+
:type => ::Sparsam::Types::STRUCT,
|
118
|
+
:class => ::US,
|
119
|
+
},
|
120
|
+
:optional => true,
|
121
|
+
:annotations => {
|
122
|
+
},
|
123
|
+
},
|
124
|
+
5 => {
|
125
|
+
:type => ::Sparsam::Types::LIST,
|
126
|
+
:name => 's_l',
|
127
|
+
:element => {
|
128
|
+
:type => ::Sparsam::Types::STRING,
|
129
|
+
},
|
130
|
+
:optional => true,
|
131
|
+
:annotations => {
|
132
|
+
},
|
133
|
+
},
|
134
|
+
6 => {
|
135
|
+
:type => ::Sparsam::Types::MAP,
|
136
|
+
:name => 'mappy',
|
137
|
+
:key => {
|
138
|
+
:type => ::Sparsam::Types::I32,
|
139
|
+
},
|
140
|
+
:value => {
|
141
|
+
:type => ::Sparsam::Types::STRING,
|
142
|
+
},
|
143
|
+
:optional => true,
|
144
|
+
:annotations => {
|
145
|
+
},
|
146
|
+
},
|
147
|
+
7 => {
|
148
|
+
:type => ::Sparsam::Types::BYTE,
|
149
|
+
:name => 'byte_field',
|
150
|
+
:optional => true,
|
151
|
+
:annotations => {
|
152
|
+
},
|
153
|
+
},
|
154
|
+
8 => {
|
155
|
+
:type => ::Sparsam::Types::STRUCT,
|
156
|
+
:name => 'un_field',
|
157
|
+
:class => ::UN,
|
158
|
+
:optional => true,
|
159
|
+
:annotations => {
|
160
|
+
},
|
161
|
+
},
|
162
|
+
9 => {
|
163
|
+
:type => ::Sparsam::Types::I32,
|
164
|
+
:name => 'magic_field',
|
165
|
+
:optional => true,
|
166
|
+
:enum_class => ::Magic ,
|
167
|
+
:annotations => {
|
168
|
+
},
|
169
|
+
},
|
170
|
+
10 => {
|
171
|
+
:type => ::Sparsam::Types::MAP,
|
172
|
+
:name => 'troll',
|
173
|
+
:key => {
|
174
|
+
:type => ::Sparsam::Types::I32,
|
175
|
+
},
|
176
|
+
:value => {
|
177
|
+
:type => ::Sparsam::Types::MAP,
|
178
|
+
:key => {
|
179
|
+
:type => ::Sparsam::Types::I32,
|
180
|
+
},
|
181
|
+
:value => {
|
182
|
+
:type => ::Sparsam::Types::I32,
|
183
|
+
},
|
184
|
+
},
|
185
|
+
:optional => true,
|
186
|
+
:annotations => {
|
187
|
+
},
|
188
|
+
}
|
189
|
+
}
|
190
|
+
|
191
|
+
ANNOTATIONS = {
|
51
192
|
}
|
52
193
|
|
53
194
|
init_thrift_struct(self)
|
@@ -55,7 +196,15 @@ end
|
|
55
196
|
|
56
197
|
class MiniRequired < ::Sparsam::Struct
|
57
198
|
FIELDS = {
|
58
|
-
1 => {
|
199
|
+
1 => {
|
200
|
+
:type => ::Sparsam::Types::I32,
|
201
|
+
:name => 'id_i32',
|
202
|
+
:annotations => {
|
203
|
+
},
|
204
|
+
}
|
205
|
+
}
|
206
|
+
|
207
|
+
ANNOTATIONS = {
|
59
208
|
}
|
60
209
|
|
61
210
|
init_thrift_struct(self)
|
@@ -63,15 +212,135 @@ end
|
|
63
212
|
|
64
213
|
class EasilyInvalid < ::Sparsam::Struct
|
65
214
|
FIELDS = {
|
66
|
-
1 => {
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
215
|
+
1 => {
|
216
|
+
:type => ::Sparsam::Types::STRUCT,
|
217
|
+
:name => 'tail',
|
218
|
+
:class => ::EasilyInvalid,
|
219
|
+
:optional => true,
|
220
|
+
:annotations => {
|
221
|
+
},
|
222
|
+
},
|
223
|
+
2 => {
|
224
|
+
:type => ::Sparsam::Types::SET,
|
225
|
+
:name => 's_self',
|
226
|
+
:element => {
|
227
|
+
:type => ::Sparsam::Types::STRUCT,
|
228
|
+
:class => ::EasilyInvalid,
|
229
|
+
},
|
230
|
+
:optional => true,
|
231
|
+
:annotations => {
|
232
|
+
},
|
233
|
+
},
|
234
|
+
3 => {
|
235
|
+
:type => ::Sparsam::Types::LIST,
|
236
|
+
:name => 'l_self',
|
237
|
+
:element => {
|
238
|
+
:type => ::Sparsam::Types::STRUCT,
|
239
|
+
:class => ::EasilyInvalid,
|
240
|
+
},
|
241
|
+
:optional => true,
|
242
|
+
:annotations => {
|
243
|
+
},
|
244
|
+
},
|
245
|
+
4 => {
|
246
|
+
:type => ::Sparsam::Types::MAP,
|
247
|
+
:name => 'mappy1',
|
248
|
+
:key => {
|
249
|
+
:type => ::Sparsam::Types::STRUCT,
|
250
|
+
:class => ::EasilyInvalid,
|
251
|
+
},
|
252
|
+
:value => {
|
253
|
+
:type => ::Sparsam::Types::I32,
|
254
|
+
},
|
255
|
+
:optional => true,
|
256
|
+
:annotations => {
|
257
|
+
},
|
258
|
+
},
|
259
|
+
5 => {
|
260
|
+
:type => ::Sparsam::Types::MAP,
|
261
|
+
:name => 'mappy2',
|
262
|
+
:key => {
|
263
|
+
:type => ::Sparsam::Types::I32,
|
264
|
+
},
|
265
|
+
:value => {
|
266
|
+
:type => ::Sparsam::Types::STRUCT,
|
267
|
+
:class => ::EasilyInvalid,
|
268
|
+
},
|
269
|
+
:optional => true,
|
270
|
+
:annotations => {
|
271
|
+
},
|
272
|
+
},
|
273
|
+
6 => {
|
274
|
+
:type => ::Sparsam::Types::MAP,
|
275
|
+
:name => 'mappy3',
|
276
|
+
:key => {
|
277
|
+
:type => ::Sparsam::Types::STRUCT,
|
278
|
+
:class => ::EasilyInvalid,
|
279
|
+
},
|
280
|
+
:value => {
|
281
|
+
:type => ::Sparsam::Types::STRUCT,
|
282
|
+
:class => ::EasilyInvalid,
|
283
|
+
},
|
284
|
+
:optional => true,
|
285
|
+
:annotations => {
|
286
|
+
},
|
287
|
+
},
|
288
|
+
7 => {
|
289
|
+
:type => ::Sparsam::Types::LIST,
|
290
|
+
:name => 'sure',
|
291
|
+
:element => {
|
292
|
+
:type => ::Sparsam::Types::MAP,
|
293
|
+
:key => {
|
294
|
+
:type => ::Sparsam::Types::SET,
|
295
|
+
:element => {
|
296
|
+
:type => ::Sparsam::Types::I32,
|
297
|
+
},
|
298
|
+
},
|
299
|
+
:value => {
|
300
|
+
:type => ::Sparsam::Types::MAP,
|
301
|
+
:key => {
|
302
|
+
:type => ::Sparsam::Types::I32,
|
303
|
+
},
|
304
|
+
:value => {
|
305
|
+
:type => ::Sparsam::Types::SET,
|
306
|
+
:element => {
|
307
|
+
:type => ::Sparsam::Types::LIST,
|
308
|
+
:element => {
|
309
|
+
:type => ::Sparsam::Types::MAP,
|
310
|
+
:key => {
|
311
|
+
:type => ::Sparsam::Types::STRUCT,
|
312
|
+
:class => ::EasilyInvalid,
|
313
|
+
},
|
314
|
+
:value => {
|
315
|
+
:type => ::Sparsam::Types::STRING,
|
316
|
+
},
|
317
|
+
},
|
318
|
+
},
|
319
|
+
},
|
320
|
+
},
|
321
|
+
},
|
322
|
+
:optional => true,
|
323
|
+
:annotations => {
|
324
|
+
},
|
325
|
+
},
|
326
|
+
8 => {
|
327
|
+
:type => ::Sparsam::Types::STRUCT,
|
328
|
+
:name => 'required_stuff',
|
329
|
+
:class => ::MiniRequired,
|
330
|
+
:optional => true,
|
331
|
+
:annotations => {
|
332
|
+
},
|
333
|
+
},
|
334
|
+
9 => {
|
335
|
+
:type => ::Sparsam::Types::I32,
|
336
|
+
:name => 'id_i32',
|
337
|
+
:optional => true,
|
338
|
+
:annotations => {
|
339
|
+
},
|
340
|
+
}
|
341
|
+
}
|
342
|
+
|
343
|
+
ANNOTATIONS = {
|
75
344
|
}
|
76
345
|
|
77
346
|
init_thrift_struct(self)
|
@@ -79,8 +348,23 @@ end
|
|
79
348
|
|
80
349
|
class NotSS < ::Sparsam::Struct
|
81
350
|
FIELDS = {
|
82
|
-
1 => {
|
83
|
-
|
351
|
+
1 => {
|
352
|
+
:type => ::Sparsam::Types::STRING,
|
353
|
+
:name => 'id_s',
|
354
|
+
:optional => true,
|
355
|
+
:annotations => {
|
356
|
+
},
|
357
|
+
},
|
358
|
+
3 => {
|
359
|
+
:type => ::Sparsam::Types::I32,
|
360
|
+
:name => 'id_i32',
|
361
|
+
:optional => true,
|
362
|
+
:annotations => {
|
363
|
+
},
|
364
|
+
}
|
365
|
+
}
|
366
|
+
|
367
|
+
ANNOTATIONS = {
|
84
368
|
}
|
85
369
|
|
86
370
|
init_thrift_struct(self)
|
@@ -88,9 +372,30 @@ end
|
|
88
372
|
|
89
373
|
class NotSS_plus < ::Sparsam::Struct
|
90
374
|
FIELDS = {
|
91
|
-
1 => {
|
92
|
-
|
93
|
-
|
375
|
+
1 => {
|
376
|
+
:type => ::Sparsam::Types::STRING,
|
377
|
+
:name => 'id_s',
|
378
|
+
:optional => true,
|
379
|
+
:annotations => {
|
380
|
+
},
|
381
|
+
},
|
382
|
+
2 => {
|
383
|
+
:type => ::Sparsam::Types::STRING,
|
384
|
+
:name => 'id_s2',
|
385
|
+
:optional => true,
|
386
|
+
:annotations => {
|
387
|
+
},
|
388
|
+
},
|
389
|
+
3 => {
|
390
|
+
:type => ::Sparsam::Types::I32,
|
391
|
+
:name => 'id_i32',
|
392
|
+
:optional => true,
|
393
|
+
:annotations => {
|
394
|
+
},
|
395
|
+
}
|
396
|
+
}
|
397
|
+
|
398
|
+
ANNOTATIONS = {
|
94
399
|
}
|
95
400
|
|
96
401
|
init_thrift_struct(self)
|
@@ -101,26 +406,200 @@ class Nothing < ::Sparsam::Struct
|
|
101
406
|
|
102
407
|
}
|
103
408
|
|
409
|
+
ANNOTATIONS = {
|
410
|
+
}
|
411
|
+
|
104
412
|
init_thrift_struct(self)
|
105
413
|
end
|
106
414
|
|
107
415
|
class EveryType < ::Sparsam::Struct
|
108
416
|
FIELDS = {
|
109
|
-
1 => {
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
417
|
+
1 => {
|
418
|
+
:type => ::Sparsam::Types::BOOL,
|
419
|
+
:name => 'a_bool',
|
420
|
+
:optional => true,
|
421
|
+
:annotations => {
|
422
|
+
},
|
423
|
+
},
|
424
|
+
2 => {
|
425
|
+
:type => ::Sparsam::Types::BYTE,
|
426
|
+
:name => 'a_byte',
|
427
|
+
:optional => true,
|
428
|
+
:annotations => {
|
429
|
+
},
|
430
|
+
},
|
431
|
+
3 => {
|
432
|
+
:type => ::Sparsam::Types::I16,
|
433
|
+
:name => 'an_i16',
|
434
|
+
:optional => true,
|
435
|
+
:annotations => {
|
436
|
+
},
|
437
|
+
},
|
438
|
+
4 => {
|
439
|
+
:type => ::Sparsam::Types::I32,
|
440
|
+
:name => 'an_i32',
|
441
|
+
:optional => true,
|
442
|
+
:annotations => {
|
443
|
+
},
|
444
|
+
},
|
445
|
+
5 => {
|
446
|
+
:type => ::Sparsam::Types::I64,
|
447
|
+
:name => 'an_i64',
|
448
|
+
:optional => true,
|
449
|
+
:annotations => {
|
450
|
+
},
|
451
|
+
},
|
452
|
+
6 => {
|
453
|
+
:type => ::Sparsam::Types::DOUBLE,
|
454
|
+
:name => 'a_double',
|
455
|
+
:optional => true,
|
456
|
+
:annotations => {
|
457
|
+
},
|
458
|
+
},
|
459
|
+
7 => {
|
460
|
+
:type => ::Sparsam::Types::STRING,
|
461
|
+
:name => 'a_binary',
|
462
|
+
:binary => true,
|
463
|
+
:optional => true,
|
464
|
+
:annotations => {
|
465
|
+
},
|
466
|
+
},
|
467
|
+
8 => {
|
468
|
+
:type => ::Sparsam::Types::STRING,
|
469
|
+
:name => 'a_string',
|
470
|
+
:optional => true,
|
471
|
+
:annotations => {
|
472
|
+
},
|
473
|
+
},
|
474
|
+
9 => {
|
475
|
+
:type => ::Sparsam::Types::LIST,
|
476
|
+
:name => 'an_i64_list',
|
477
|
+
:element => {
|
478
|
+
:type => ::Sparsam::Types::I64,
|
479
|
+
},
|
480
|
+
:optional => true,
|
481
|
+
:annotations => {
|
482
|
+
},
|
483
|
+
},
|
484
|
+
10 => {
|
485
|
+
:type => ::Sparsam::Types::SET,
|
486
|
+
:name => 'an_i64_set',
|
487
|
+
:element => {
|
488
|
+
:type => ::Sparsam::Types::I64,
|
489
|
+
},
|
490
|
+
:optional => true,
|
491
|
+
:annotations => {
|
492
|
+
},
|
493
|
+
},
|
494
|
+
11 => {
|
495
|
+
:type => ::Sparsam::Types::MAP,
|
496
|
+
:name => 'an_i64_map',
|
497
|
+
:key => {
|
498
|
+
:type => ::Sparsam::Types::I64,
|
499
|
+
},
|
500
|
+
:value => {
|
501
|
+
:type => ::Sparsam::Types::I64,
|
502
|
+
},
|
503
|
+
:optional => true,
|
504
|
+
:annotations => {
|
505
|
+
},
|
506
|
+
},
|
507
|
+
12 => {
|
508
|
+
:type => ::Sparsam::Types::LIST,
|
509
|
+
:name => 'a_list_of_i64_maps',
|
510
|
+
:element => {
|
511
|
+
:type => ::Sparsam::Types::MAP,
|
512
|
+
:key => {
|
513
|
+
:type => ::Sparsam::Types::I64,
|
514
|
+
},
|
515
|
+
:value => {
|
516
|
+
:type => ::Sparsam::Types::I64,
|
517
|
+
},
|
518
|
+
},
|
519
|
+
:optional => true,
|
520
|
+
:annotations => {
|
521
|
+
},
|
522
|
+
},
|
523
|
+
13 => {
|
524
|
+
:type => ::Sparsam::Types::MAP,
|
525
|
+
:name => 'a_map_of_i64_maps',
|
526
|
+
:key => {
|
527
|
+
:type => ::Sparsam::Types::MAP,
|
528
|
+
:key => {
|
529
|
+
:type => ::Sparsam::Types::I64,
|
530
|
+
},
|
531
|
+
:value => {
|
532
|
+
:type => ::Sparsam::Types::I64,
|
533
|
+
},
|
534
|
+
},
|
535
|
+
:value => {
|
536
|
+
:type => ::Sparsam::Types::MAP,
|
537
|
+
:key => {
|
538
|
+
:type => ::Sparsam::Types::I64,
|
539
|
+
},
|
540
|
+
:value => {
|
541
|
+
:type => ::Sparsam::Types::I64,
|
542
|
+
},
|
543
|
+
},
|
544
|
+
:optional => true,
|
545
|
+
:annotations => {
|
546
|
+
},
|
547
|
+
},
|
548
|
+
14 => {
|
549
|
+
:type => ::Sparsam::Types::STRUCT,
|
550
|
+
:name => 'a_struct',
|
551
|
+
:class => ::US,
|
552
|
+
:optional => true,
|
553
|
+
:annotations => {
|
554
|
+
},
|
555
|
+
},
|
556
|
+
15 => {
|
557
|
+
:type => ::Sparsam::Types::STRUCT,
|
558
|
+
:name => 'a_union',
|
559
|
+
:class => ::UN,
|
560
|
+
:optional => true,
|
561
|
+
:annotations => {
|
562
|
+
},
|
563
|
+
}
|
564
|
+
}
|
565
|
+
|
566
|
+
ANNOTATIONS = {
|
567
|
+
}
|
568
|
+
|
569
|
+
init_thrift_struct(self)
|
570
|
+
end
|
571
|
+
|
572
|
+
class RecursiveStruct < ::Sparsam::Struct
|
573
|
+
FIELDS = {
|
574
|
+
1 => {
|
575
|
+
:type => ::Sparsam::Types::I64,
|
576
|
+
:name => 'id',
|
577
|
+
:optional => true,
|
578
|
+
:annotations => {
|
579
|
+
},
|
580
|
+
},
|
581
|
+
2 => {
|
582
|
+
:type => ::Sparsam::Types::STRUCT,
|
583
|
+
:name => 'self_struct',
|
584
|
+
:class => ::RecursiveStruct,
|
585
|
+
:optional => true,
|
586
|
+
:annotations => {
|
587
|
+
},
|
588
|
+
},
|
589
|
+
3 => {
|
590
|
+
:type => ::Sparsam::Types::LIST,
|
591
|
+
:name => 'self_list',
|
592
|
+
:element => {
|
593
|
+
:type => ::Sparsam::Types::STRUCT,
|
594
|
+
:class => ::RecursiveStruct,
|
595
|
+
},
|
596
|
+
:optional => true,
|
597
|
+
:annotations => {
|
598
|
+
},
|
599
|
+
}
|
600
|
+
}
|
601
|
+
|
602
|
+
ANNOTATIONS = {
|
124
603
|
}
|
125
604
|
|
126
605
|
init_thrift_struct(self)
|
@@ -128,7 +607,16 @@ end
|
|
128
607
|
|
129
608
|
class SimpleException < ::Sparsam::ApplicationException
|
130
609
|
FIELDS = {
|
131
|
-
1 => {
|
610
|
+
1 => {
|
611
|
+
:type => ::Sparsam::Types::STRING,
|
612
|
+
:name => 'message',
|
613
|
+
:optional => true,
|
614
|
+
:annotations => {
|
615
|
+
},
|
616
|
+
}
|
617
|
+
}
|
618
|
+
|
619
|
+
ANNOTATIONS = {
|
132
620
|
}
|
133
621
|
|
134
622
|
init_thrift_struct(self)
|
@@ -136,8 +624,23 @@ end
|
|
136
624
|
|
137
625
|
class WithFieldsException < ::Sparsam::ApplicationException
|
138
626
|
FIELDS = {
|
139
|
-
1 => {
|
140
|
-
|
627
|
+
1 => {
|
628
|
+
:type => ::Sparsam::Types::I64,
|
629
|
+
:name => 'an_i64',
|
630
|
+
:optional => true,
|
631
|
+
:annotations => {
|
632
|
+
},
|
633
|
+
},
|
634
|
+
2 => {
|
635
|
+
:type => ::Sparsam::Types::STRING,
|
636
|
+
:name => 'message',
|
637
|
+
:optional => true,
|
638
|
+
:annotations => {
|
639
|
+
},
|
640
|
+
}
|
641
|
+
}
|
642
|
+
|
643
|
+
ANNOTATIONS = {
|
141
644
|
}
|
142
645
|
|
143
646
|
init_thrift_struct(self)
|
data/spec/sparsam_spec.rb
CHANGED
@@ -489,6 +489,23 @@ describe 'Sparsam' do
|
|
489
489
|
end
|
490
490
|
end
|
491
491
|
|
492
|
+
it 'handles recursive structs' do
|
493
|
+
recursive_struct = RecursiveStruct.new
|
494
|
+
recursive_struct.id = 1
|
495
|
+
recursive_struct.self_struct = RecursiveStruct.new
|
496
|
+
recursive_struct.self_struct.id = 2
|
497
|
+
recursive_struct.self_list = [RecursiveStruct.new]
|
498
|
+
recursive_struct.self_list[0].id = 3
|
499
|
+
|
500
|
+
data = recursive_struct.serialize
|
501
|
+
|
502
|
+
new_recursive = Sparsam::Deserializer.deserialize(RecursiveStruct, data)
|
503
|
+
|
504
|
+
new_recursive.id.should == 1
|
505
|
+
new_recursive.self_struct.id.should == 2
|
506
|
+
new_recursive.self_list[0].id.should == 3
|
507
|
+
end
|
508
|
+
|
492
509
|
it 'handles structs with modified eigenclasses' do
|
493
510
|
nested_struct = US.new
|
494
511
|
|
data/spec/user.thrift
CHANGED
@@ -82,6 +82,12 @@ struct EveryType {
|
|
82
82
|
15: optional UN a_union
|
83
83
|
}
|
84
84
|
|
85
|
+
struct RecursiveStruct {
|
86
|
+
1: optional i64 id
|
87
|
+
2: optional RecursiveStruct self_struct
|
88
|
+
3: optional list<RecursiveStruct> self_list
|
89
|
+
}
|
90
|
+
|
85
91
|
exception SimpleException {
|
86
92
|
1: optional string message
|
87
93
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sparsam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airbnb Thrift Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
version: '0'
|
166
166
|
requirements: []
|
167
167
|
rubyforge_project: thrift
|
168
|
-
rubygems_version: 2.
|
168
|
+
rubygems_version: 2.5.1
|
169
169
|
signing_key:
|
170
170
|
specification_version: 4
|
171
171
|
summary: Ruby bindings for Apache Thrift
|