Skip to content

CSVFormatter returns "no tables defined" for top-level map[string]any #122

Description

@adityathebe

After fixing #38, formatting a top-level map[string]any as CSV now succeeds at the conversion stage but the formatter errors out with no tables defined.

Repro:

data := map[string]any{"name": "clicky", "count": 42}
out, err := csvFormatter.Format(data, FormatOptions{Format: "csv"})
// out == "", err == "no tables defined"

The Markdown path renders the map as a key/value list, but CSVFormatter.FormatPrettyData (formatters/csv_formatter.go) only handles *api.TextTable and returns the error when FirstTable() is nil. Maps produce a TypedMap, not a Table, so the formatter has no way to render them as CSV today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions