You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (Jira)" <ji...@apache.org> on 2022/05/03 23:05:00 UTC

[jira] [Commented] (THRIFT-5577) netstd namespace directive creates matching subfolders

    [ https://issues.apache.org/jira/browse/THRIFT-5577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17531443#comment-17531443 ] 

Jens Geyer commented on THRIFT-5577:
------------------------------------

With 

{code}
namespace netstd MyCompany.MyFeature.Xyz.Thrift
struct Foo {}
{code}

the call to 

{code}
thrift --gen netstd --out .\thrift rpc.thrift
{code}

gives the expected

{code}
$> tree .\thrift\
(path omitted)\THRIFT
└───MyCompany
    └───MyFeature
        └───Xyz
            └───Thrift
$>
{code}

whereas 

{code}
thrift --gen netstd  rpc.thrift
{code}

gives the default

{code}
$> tree .\gen-netstd\

(path omitted)\GEN-NETSTD
└───MyCompany
    └───MyFeature
        └───Xyz
            └───Thrift
$>
{code}

Also, the path {{MyCompany\MyFeature\Xyz\Thrift}} matches the namespace {{MyCompany.MyFeature.Xyz.Thrift}} exactly.


> netstd namespace directive creates matching subfolders
> ------------------------------------------------------
>
>                 Key: THRIFT-5577
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5577
>             Project: Thrift
>          Issue Type: Improvement
>          Components: netstd - Compiler
>    Affects Versions: 0.16.0
>            Reporter: Philip Lee
>            Priority: Major
>
> If I add a namespace directive to the .thrift file, and I specify the output folder, the thrift compiler creates a set of sub-folders matching the namespace which is not useful.
> e.g. I have a project called 
> MyCompany.MyFeature.Xyz
> and I have a .thrift file with
> namespace netstd MyCompany.MyFeature.Xyz.Thrift
> and I use
> thrift-0.16.0.exe --gen netstd --out .\thrift rpc.thrift
> Then I get sub-folders
> MyCompany.MyFeature.Xyz\Thrift\MyCompany\MyFeature\Xyz\Thrift\<files.cs>
> What I expect is for the generated files to be placed in folder Thrift, e.g.
> MyCompany.MyFeature.Xyz\Thrift\<files.cs>
> to match the namespace.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)