Skip to content

referenceText should not emit invalid MQL for unsafe field names #709

@hanhan761

Description

@hanhan761

Problem

toFieldCompletionItems() currently emits referenceText as $ + field path for every field. That breaks for field names that are not safe as a plain $field reference, such as:

  • order-items
  • my field
  • say"hi"

Expected: unsafe names should not produce a broken aggregation reference.
Current: the completion data exposes an invalid referenceText, which can lead to bad MQL if consumed directly.

Notes

This was documented as future work in src/utils/json/data-api/autocomplete/future-work.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions