Typed value classes for nested operator arguments in the builder

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: Builder
    • None
    • None
    • PHP Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Some MQL operators take object-typed arguments with a fixed set of named sub-fields (for example $rankFusion, $scoreFusion). Today the builder exposes these as plain array|stdClass, so there is no autocompletion, no static typing, and no validation of the sub-fields at the API level.

      Goal: generate a dedicated typed class per such argument, so users of the builder API get proper typing and IDE support for these nested structures instead of untyped arrays.

      The MQL specifications already support describing this structure (recursive arguments key on object-typed arguments, see mongodb/mql-specifications#33, merged). The generator needs to consume it to produce the typed classes.

      A prior attempt exists in mongodb/mongo-php-library#1886 (closed, not merged) and can be used as a reference, but needs rework: rebase on v2.x and address the Psalm findings rather than adding them to the baseline.

            Assignee:
            Unassigned
            Reporter:
            Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: