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

Support multi-level chained structs

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Server Programmability

      Currently, it is not supported to have more than one level of chained structs. There does not seem to be a particular reason for such limitation other than avoiding to have to check for circular dependencies.

      This arbitrary limitation is providing developers from using IDLs for some trivial use cases as the one from the example below:

      struct:
          Base:
              description: "..."
              fields:
                  a:
                      description: "a"
                      type: int
          
          Specialization:
              description: "..."
              chained_structs:
                  Base: Base
              fields:
                  b:
                      description: "b"
                      type: int
      
           SpecializationOfSpecialization:
              description: "..."
              chained_structs:
                  Specialization: Specialization
      

      With the above code, the IDL generator returns the following error: Struct 'SpecializationOfSpecialization' is not allowed to nest struct 'Specialization' since it has chained structs and/or types.

            Assignee:
            Unassigned Unassigned
            Reporter:
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: