OCaml generator to take default values into account 
----------------------------------------------------

                 Key: THRIFT-827
                 URL: https://issues.apache.org/jira/browse/THRIFT-827
             Project: Thrift
          Issue Type: Improvement
          Components: Compiler (General)
    Affects Versions: 0.3
            Reporter: Lev Walkin
            Priority: Minor
             Fix For: 0.4


A patch to the OCaml generator which uses default values defined in the .thrift 
file to initialize the members of the generated class.

I've prepared an OCaml generator patch against the current Thrift SVN trunk. 
The generated code:
* makes unwrapped types for all fields for which default values are defined,
* honors the protocol-centric semantics for the "required" field: such fields 
are always serialized,
* throws exception instead of skipping "required" fields which do not have a 
set value,
* avoids encoding values of "optional" and absent-requiredness fields if the 
field value is structurally equivalent to the field's default value,
* does not break compatibility with C++ receivers,
* is drop-in compatibe with OCaml code generated by the OCaml generator in the 
unmodified trunk

For the full description of changes see paragraph 3.2 in 
http://lionet.livejournal.com/66899.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to