Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-28936

Add support for alternate names for fields in generated code in IDL

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.7
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Platforms 2017-05-08

      For some IDL generated classes, it is desirable to differentiate between the field names in BSON and the names in the generated C++ code. A good example of this is oplog entries which use one and two letter field names to keep the BSON small but may desire for the code to have a more verbose description of a field.

      Example:

          demo_struct:
              fields:
                  o:
                      type: int
                      cpp_name: operation
      

      Instead of generating:

      std::int32_t getO() const;
      void setO(std::int32_t value) const;
      

      more descriptive names will be used instead.

      std::int32_t getOperation() const;
      void setOperation(std::int32_t value) const;
      

      Reported by judah.schvimer

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: