Skip to content

Commit 9255e58

Browse files
aristidispfacebook-github-bot
authored andcommitted
fbcode/common/hs/thrift/exactprint/tests/fbthrift-tests/adapter/src/module.thrift (+8 more)
Summary: Feedback/questions? Ping aristidisp. Reviewed By: vitaut Differential Revision: D80322225 fbshipit-source-id: 38e74d7822d540581cfd1a04aca9441861016875
1 parent 9c4df89 commit 9255e58

9 files changed

Lines changed: 74 additions & 0 deletions

File tree

exactprint/tests/fbthrift-tests/adapter/src/module.thrift

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,19 @@ include "thrift/annotation/rust.thrift"
3232
@thrift.Experimental
3333
package "facebook.com/thrift/test"
3434

35+
@thrift.AllowLegacyTypedefUri
3536
@hack.Adapter{name = '\\Adapter2'}
3637
@cpp.Adapter{name = '::my::Adapter2'}
3738
@rust.Adapter{name = "::my::Adapter2"}
3839
typedef set<string> (py.adapter = 'my.Adapter2') SetWithAdapter
40+
@thrift.AllowLegacyTypedefUri
3941
@hack.Adapter{name = '\\Adapter1'}
4042
@cpp.Adapter{name = '::my::Adapter1'}
4143
@rust.Adapter{name = "::my::Adapter1"}
4244
typedef string (py.adapter = 'my.Adapter1') StringWithAdapter
45+
@thrift.AllowLegacyTypedefUri
4346
typedef list<StringWithAdapter> ListWithElemAdapter
47+
@thrift.AllowLegacyTypedefUri
4448
@hack.Adapter{name = '\\Adapter2'}
4549
@cpp.Adapter{name = '::my::Adapter2'}
4650
@rust.Adapter{name = "::my::Adapter2"}
@@ -63,13 +67,16 @@ struct MyAnnotation {
6367
2: Color color = Color.RED;
6468
}
6569

70+
@thrift.AllowLegacyTypedefUri
6671
@cpp.Adapter{name = "::my::Adapter1"}
6772
@rust.Adapter{name = "::my::Adapter1"}
6873
@MyAnnotation{signature = "MyI64", color = Color.GREEN}
6974
typedef i64 MyI64
7075

76+
@thrift.AllowLegacyTypedefUri
7177
typedef MyI64 DoubleTypedefI64
7278

79+
@thrift.AllowLegacyTypedefUri
7380
@hack.Adapter{name = '\\Adapter1'}
7481
@cpp.Adapter{name = '::my::Adapter1'}
7582
@rust.Adapter{name = "::my::Adapter1"}
@@ -142,6 +149,7 @@ union Baz {
142149
9: MyI64 longField;
143150
}
144151

152+
@thrift.AllowLegacyTypedefUri
145153
@hack.Adapter{name = '\\Adapter1'}
146154
@cpp.Adapter{name = '::my::Adapter1'}
147155
@rust.Adapter{name = "::my::Adapter1"}
@@ -209,17 +217,20 @@ struct TerseAdaptedFields {
209217
3: set<i32> set_field;
210218
}
211219

220+
@thrift.AllowLegacyTypedefUri
212221
@hack.Adapter{name = '\\Adapter2'}
213222
@cpp.Adapter{name = '::my::Adapter2'}
214223
typedef Bar (py.adapter = 'my.Adapter2') StructWithAdapter
215224

225+
@thrift.AllowLegacyTypedefUri
216226
@hack.Adapter{name = '\\Adapter2'}
217227
@cpp.Adapter{name = '::my::Adapter2'}
218228
typedef Baz (py.adapter = 'my.Adapter2') UnionWithAdapter
219229

220230
struct B {
221231
1: AdaptedA a;
222232
}
233+
@thrift.AllowLegacyTypedefUri
223234
@cpp.Adapter{name = "::my::Adapter"}
224235
typedef A AdaptedA
225236
struct A {}
@@ -265,37 +276,49 @@ const string var5 = "50";
265276
@Config{path = "baz2"}
266277
const MyStruct var6 = MyStruct{field = 60, set_string = ["30", "40"]};
267278

279+
@thrift.AllowLegacyTypedefUri
268280
@cpp.Adapter{name = "::apache::thrift::test::AdaptTestMsAdapter"}
269281
typedef i64 DurationMs
270282

283+
@thrift.AllowLegacyTypedefUri
271284
@cpp.Adapter{name = "::apache::thrift::test::TemplatedTestAdapter"}
272285
typedef bool AdaptedBool
273286

287+
@thrift.AllowLegacyTypedefUri
274288
@cpp.Adapter{name = "::apache::thrift::test::TemplatedTestAdapter"}
275289
typedef byte AdaptedByte
276290

291+
@thrift.AllowLegacyTypedefUri
277292
@cpp.Adapter{name = "::apache::thrift::test::TemplatedTestAdapter"}
278293
typedef i16 AdaptedShort
279294

295+
@thrift.AllowLegacyTypedefUri
280296
@cpp.Adapter{name = "::apache::thrift::test::TemplatedTestAdapter"}
281297
typedef i32 AdaptedInteger
282298

299+
@thrift.AllowLegacyTypedefUri
283300
@cpp.Adapter{name = "::apache::thrift::test::TemplatedTestAdapter"}
284301
typedef i64 AdaptedLong
285302

303+
@thrift.AllowLegacyTypedefUri
286304
@cpp.Adapter{name = "::apache::thrift::test::TemplatedTestAdapter"}
287305
typedef double AdaptedDouble
288306

307+
@thrift.AllowLegacyTypedefUri
289308
@cpp.Adapter{name = "::apache::thrift::test::TemplatedTestAdapter"}
290309
typedef string AdaptedString
291310

311+
@thrift.AllowLegacyTypedefUri
292312
typedef AdaptedBool DoubleTypedefBool
293313

314+
@thrift.AllowLegacyTypedefUri
294315
@cpp.Type{name = "::folly::IOBuf"}
295316
typedef binary IOBuf
317+
@thrift.AllowLegacyTypedefUri
296318
@cpp.Adapter{name = "::apache::thrift::test::CustomProtocolAdapter"}
297319
typedef IOBuf CustomProtocolType
298320

321+
@thrift.AllowLegacyTypedefUri
299322
@cpp.Adapter{
300323
name = "::apache::thrift::IndirectionAdapter<::apache::thrift::test::IndirectionString>",
301324
}
@@ -329,6 +352,7 @@ enum ThriftAdaptedEnum {
329352
Zero = 0,
330353
One = 1,
331354
}
355+
@thrift.AllowLegacyTypedefUri
332356
@cpp.Adapter{
333357
name = "::apache::thrift::StaticCastAdapter<::apache::thrift::test::basic::AdaptedEnum, ::apache::thrift::test::basic::ThriftAdaptedEnum>",
334358
}
@@ -383,6 +407,7 @@ struct AdaptedStruct {
383407
1: i64 data;
384408
}
385409

410+
@thrift.AllowLegacyTypedefUri
386411
@cpp.Adapter{name = "::apache::thrift::test::TemplatedTestAdapter"}
387412
typedef AdaptedStruct AdaptedTypedef
388413

@@ -391,6 +416,7 @@ struct DirectlyAdaptedStruct {
391416
1: i64 data;
392417
}
393418

419+
@thrift.AllowLegacyTypedefUri
394420
typedef DirectlyAdaptedStruct TypedefOfDirect
395421

396422
struct StructFieldAdaptedStruct {
@@ -408,6 +434,7 @@ struct CircularStruct {
408434
@cpp.Ref{type = cpp.RefType.Unique}
409435
1: optional AdaptedCircularAdaptee field;
410436
}
437+
@thrift.AllowLegacyTypedefUri
411438
@cpp.Adapter{
412439
name = "::apache::thrift::test::MemberAccessAdapter",
413440
adaptedType = "::apache::thrift::test::TaggedWrapper<CircularAdaptee, CircularStruct>",
@@ -463,6 +490,7 @@ struct ApplyAdapter {}
463490
@ApplyAdapter
464491
struct TransitiveAdapted {}
465492

493+
@thrift.AllowLegacyTypedefUri
466494
@cpp.Adapter{name = "::apache::thrift::test::CountingAdapter<true, int>"}
467495
typedef i64 CountingInt
468496
struct CountingStruct {
@@ -515,19 +543,29 @@ const MoveOnly nested_adapted = {"ptr": {}};
515543
const list<AdaptedByte> container_of_adapted = [1, 2, 3];
516544

517545
// The following were automatically generated and may benefit from renaming.
546+
@thrift.AllowLegacyTypedefUri
518547
typedef FooWithAdapter (py.adapter = "my.Adapter1") FooWithAdapter_9317
548+
@thrift.AllowLegacyTypedefUri
519549
typedef ListWithElemAdapter_withAdapter (
520550
py.adapter = "my.Adapter2",
521551
) ListWithElemAdapter_withAdapter_2312
552+
@thrift.AllowLegacyTypedefUri
522553
typedef MyI32 (py.adapter = "my.Adapter1") MyI32_4873
554+
@thrift.AllowLegacyTypedefUri
523555
typedef StringWithAdapter (py.adapter = "my.Adapter2") StringWithAdapter_7208
524556

525557
// The following were automatically generated and may benefit from renaming.
558+
@thrift.AllowLegacyTypedefUri
526559
typedef Baz (py.adapter = "my.Adapter1") Baz_7352
560+
@thrift.AllowLegacyTypedefUri
527561
typedef Foo (py.adapter = "my.Adapter1") Foo_3943
562+
@thrift.AllowLegacyTypedefUri
528563
typedef Foo (py.adapter = "::my.Adapter1") Foo_6868
564+
@thrift.AllowLegacyTypedefUri
529565
typedef binary (py.adapter = "my.Adapter1") binary_5673
566+
@thrift.AllowLegacyTypedefUri
530567
typedef i32 (py.adapter = "my.Adapter1") i32_5137
568+
@thrift.AllowLegacyTypedefUri
531569
typedef map<string, ListWithElemAdapter_withAdapter_2312> (
532570
py.adapter = "my.Adapter3",
533571
) map_string_ListWithElemAdapter_withAdapter_8454

exactprint/tests/fbthrift-tests/basic-structured-annotations/src/module.thrift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,16 @@ struct structured_annotation_nested {
5454
2: structured_annotation_with_default nest;
5555
}
5656

57+
@thrift.AllowLegacyTypedefUri
5758
@structured_annotation_with_default
5859
typedef string annotated_with_default_string
5960

61+
@thrift.AllowLegacyTypedefUri
6062
@structured_annotation_inline{count = 1}
6163
@structured_annotation_with_default{name = 'abc'}
6264
typedef string annotated_inline_string
6365

66+
@thrift.AllowLegacyTypedefUri
6467
@structured_annotation_inline{count = 2}
6568
typedef i64 annotated_inline_i64
6669

exactprint/tests/fbthrift-tests/basic/src/module.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ enum MyEnum {
4646
MyValue2 = 1,
4747
}
4848

49+
@thrift.AllowLegacyTypedefUri
4950
typedef MyEnum MyEnumAlias
5051

5152
struct MyStruct {
@@ -70,6 +71,7 @@ struct Containers {
7071
}
7172

7273
struct MyDataItem {}
74+
@thrift.AllowLegacyTypedefUri
7375
typedef MyDataItem MyDataItemAlias
7476

7577
union MyUnion {

exactprint/tests/fbthrift-tests/encode/src/module.thrift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ struct Foo {
2828
1: i32 field;
2929
}
3030

31+
@thrift.AllowLegacyTypedefUri
3132
@cpp.Adapter{name = "::apache::thrift::test::TemplatedTestAdapter"}
3233
typedef Foo AdaptedFoo
3334

exactprint/tests/fbthrift-tests/python_capi/src/containers.thrift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020

2121
include "thrift/annotation/cpp.thrift"
22+
include "thrift/annotation/thrift.thrift"
2223

2324
cpp_include "<deque>"
2425
cpp_include "<unordered_map>"
@@ -31,15 +32,19 @@ cpp_include "<thrift/test/python_capi/indirection.h>"
3132

3233
package "test.dev/fixtures/python_capi"
3334

35+
@thrift.AllowLegacyTypedefUri
3436
@cpp.Type{name = "folly::IOBuf"}
3537
typedef binary IOBuf
3638

39+
@thrift.AllowLegacyTypedefUri
3740
@cpp.Type{template = "folly::small_vector"}
3841
typedef list<IOBuf> small_vector_iobuf
3942

43+
@thrift.AllowLegacyTypedefUri
4044
@cpp.Type{template = "folly::fbvector"}
4145
typedef list<string> fbvector_string
4246

47+
@thrift.AllowLegacyTypedefUri
4348
@cpp.Type{template = "folly::fbvector"}
4449
typedef list<fbvector_string> fbvector_fbvector_string
4550

@@ -107,13 +112,15 @@ struct TWrapped {
107112
1: string fieldA;
108113
2: binary fieldB;
109114
}
115+
@thrift.AllowLegacyTypedefUri
110116
typedef list<TWrapped> ListOfWrapped
111117

112118
// Should not be marshaled
113119
struct IndirectionA {
114120
1: ListOfWrapped lst;
115121
}
116122

123+
@thrift.AllowLegacyTypedefUri
117124
@cpp.Type{template = "std::vector"}
118125
typedef list<TWrapped> VecOfWrapped
119126

@@ -122,6 +129,7 @@ struct IndirectionB {
122129
1: VecOfWrapped lst;
123130
}
124131

132+
@thrift.AllowLegacyTypedefUri
125133
typedef ListOfWrapped ListOfWrappedAlias
126134

127135
// Should also not be marshaled

exactprint/tests/fbthrift-tests/python_capi/src/module.thrift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ cpp_include "thrift/lib/cpp2/util/ManagedStringView.h"
3838

3939
package "test.dev/fixtures/python_capi"
4040

41+
@thrift.AllowLegacyTypedefUri
4142
@cpp.Type{name = "uint64_t"}
4243
typedef i64 uint64
44+
@thrift.AllowLegacyTypedefUri
4345
typedef uint64 ui64
4446

4547
enum MyEnum {
@@ -90,9 +92,12 @@ struct StringPair {
9092
@cpp.Name{value = "VapidStruct"}
9193
struct EmptyStruct {}
9294

95+
@thrift.AllowLegacyTypedefUri
9396
typedef byte signed_byte
97+
@thrift.AllowLegacyTypedefUri
9498
@cpp.Type{name = "folly::IOBuf"}
9599
typedef binary IOBuf
100+
@thrift.AllowLegacyTypedefUri
96101
@cpp.Type{name = "std::unique_ptr<folly::IOBuf>"}
97102
typedef binary IOBufPtr
98103

@@ -149,6 +154,7 @@ struct ListStruct {
149154
8: list<list<list<signed_byte>>> voxels;
150155
9: list<IOBufPtr> buf_ptrs;
151156
} (cpp.noncopyable)
157+
@thrift.AllowLegacyTypedefUri
152158
typedef ListStruct ListAlias
153159

154160
@cpp.EnableCustomTypeOrdering

exactprint/tests/fbthrift-tests/terse_write/src/terse_write.thrift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ struct FieldLevelTerseStruct {
123123
30: MyUnion union_field;
124124
}
125125

126+
@thrift.AllowLegacyTypedefUri
126127
@hack.Adapter{name = '\\Adapter1'}
127128
@cpp.Adapter{name = "::my::Adapter"}
128129
typedef i32 MyInteger

exactprint/tests/fbthrift-tests/types/src/included.thrift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
package "apache.org/thrift/fixtures/types"
2222

2323
include "thrift/annotation/cpp.thrift"
24+
include "thrift/annotation/thrift.thrift"
2425

26+
@thrift.AllowLegacyTypedefUri
2527
@cpp.Type{template = "std::unordered_map"}
2628
typedef map<i32, string> SomeMap
29+
@thrift.AllowLegacyTypedefUri
2730
typedef list<SomeMap> SomeListOfTypeMap

exactprint/tests/fbthrift-tests/types/src/module.thrift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ include "thrift/annotation/thrift.thrift"
2525

2626
package "apache.org/thrift/fixtures/types"
2727

28+
@thrift.AllowLegacyTypedefUri
2829
typedef binary TBinary
2930

3031
struct empty_struct {}
@@ -236,7 +237,9 @@ struct AllocatorAware2 {
236237
2: optional i32 box_field;
237238
} (cpp.allocator = "some_allocator")
238239

240+
@thrift.AllowLegacyTypedefUri
239241
typedef i32 IntTypedef
242+
@thrift.AllowLegacyTypedefUri
240243
@cpp.Type{name = "std::uint32_t"}
241244
typedef IntTypedef UintTypedef
242245

@@ -251,17 +254,26 @@ struct StructWithDoubleUnderscores {
251254
}
252255

253256
// The following were automatically generated and may benefit from renaming.
257+
@thrift.AllowLegacyTypedefUri
254258
typedef included.SomeListOfTypeMap (
255259
noop_annotation = "1",
256260
) SomeListOfTypeMap_2468
261+
@thrift.AllowLegacyTypedefUri
257262
typedef TBinary (noop_annotation = "1") TBinary_8623
263+
@thrift.AllowLegacyTypedefUri
258264
typedef i32 (cpp.use_allocator = "1") i32_9314
265+
@thrift.AllowLegacyTypedefUri
259266
typedef list<i32> (cpp.use_allocator = "1") list_i32_9187
267+
@thrift.AllowLegacyTypedefUri
260268
typedef map<i32, i32> (cpp.use_allocator = "1") map_i32_i32_9565
269+
@thrift.AllowLegacyTypedefUri
261270
@rust.Type{name = "sorted_vector_map::SortedVectorMap"}
262271
typedef map<i32, string> map_i32_string_1261
272+
@thrift.AllowLegacyTypedefUri
263273
typedef set<i32> (cpp.use_allocator = "1") set_i32_7070
274+
@thrift.AllowLegacyTypedefUri
264275
@cpp.Type{template = "folly::sorted_vector_set"}
265276
@rust.Type{name = "sorted_vector_map::SortedVectorSet"}
266277
typedef set<i32> set_i32_7194
278+
@thrift.AllowLegacyTypedefUri
267279
typedef string (cpp.use_allocator = "1") string_5252

0 commit comments

Comments
 (0)