Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to "include" Thrift files from different modules?

Scenario: One big project with multiple sub-projects, SBT build definition.

rootproject/
  api/
    src/
      main/
       thrift/
         SomeService.thrift
  core/
    src/
      main/
        thrift/
         SomeModel.thrift

What is the correct way to include SomeModel.thrift in SomeService.thrift?

like image 221
flavian Avatar asked Jun 26 '26 13:06

flavian


1 Answers

Managed to find the answer. Path inclusion works as expected:

SomeService.thrift looks like this:

include ../../../../SomeModels.thrift

// And then normal IDL definitions
struct Test {
    1: required SomeModels.Model model
}
like image 105
flavian Avatar answered Jun 29 '26 16:06

flavian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!