IDL generated serializer does not use command_name

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: IDL
    • Server Programmability
    • ALL
    • Programmability 2025-07-07
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      A command's name is by default taken to be the field name that contains the command's definition, but it can be overridden by specifying the command_name field. The generated serializer does not use this overridden name though and will instead use the YAML map field name.

      e.g.

      the following definition:

      clusterFsyncUnlock:         
          command_name: fsyncUnlock
          cpp_name: clusterFsyncUnlock
          strict: false
          namespace: ignored
          api_version: "" 
      

      produces the following incorrectly generated serializer:

      void ClusterFsyncUnlock::serialize(BSONObjBuilder* builder) const {
          _hasMembers.required();
      
          builder->append("clusterFsyncUnlock"_sd, 1);
          {
              _genericArguments.serialize(builder);
          }
      }
      

              Assignee:
              Eduardo Lopez
              Reporter:
              Patrick Freed
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: