Skip to content

Conversation

@bgould
Copy link
Contributor

@bgould bgould commented Jan 6, 2016

I've put together an XML model for Thrift IDL that is very similar in concept and structure to the model created by the JSON generator of the Thrift compiler. The code is based on the JSON generator, and inherits the 'merge' option from that module for including the model of all includes in a single file if desired.

This generator is useful if you wish to extend the Thrift compiler with some XML based templating engine such as XSLT. For example I have prototyped transforms that can create valid XML schema and WSDL files from Thrift IDL, as well as transform SOAP requests and responses to and from Thrift messages. Those transforms are not included because they may be outside the scope of Thrift, but I can provide them if interested. Regardless, I feel the XML model is generally useful and might be a good addition to the Thrift compiler.

Also included is an XML schema for the model file format and tests that generate XML from existing IDL in the Thrift test suite to validate against that schema. These tests are Ant based and so only run when --with-java is enabled in ./configure

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I read this correctly, the <attribute name="required" type="tns:Requiredness" /> must be specified. But there are only two possible values for it. We have three ... if neither required nor optional are specified, the member is of the so-called "default" requiredness (which basically says: it may not be in the data you read, but please always write it).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I did not read it correctly. The attribute is of course optional by default, and that's perfectly fine.

@asfgit asfgit closed this in de0b4b5 Jan 10, 2016
gadLinux pushed a commit to gadLinux/thrift that referenced this pull request Mar 6, 2016
Client: XML
Patch: Benjamin Gould, with minor modifications by Jens Geyer

This closes apache#774
allengeorge pushed a commit to allengeorge/thrift that referenced this pull request Jan 1, 2017
Client: XML
Patch: Benjamin Gould, with minor modifications by Jens Geyer

This closes apache#774
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants