Skip to content

Consistently handle example json escaping #301

@addshore

Description

@addshore

When specifying filters like this

        'filter': [
            {"limit":10,"order":["timestamp DESC"]},
            {"where":{"type":"temp"},"limit":10,"order":["timestamp DESC"]},
            {"where":{"type":"temp","timestamp":{"between":["2024-12-01T00:00:00.000Z","2024-12-01T23:59:59.999Z"]}},"order":["timestamp DESC"]},
        ],

Examples are displayed like this

Image

Which looks nice, and is copyable in the left-hand side, however the right hand side syas [object Obvject] etc...


When specifying strings of json as the filters like this

        'filter': [
            '{"limit":10,"order":["timestamp DESC"]}',
            '{"where":{"timestamp":{"between":["2024-12-01T00:00:00.000Z","2024-12-01T23:59:59.999Z"]}},"order":["timestamp DESC"]}',
            '{"where":{"correlationId":"abc123"}}',
        ],

We get an ugly left-hand side with escaping, and a nice right-hand side placeholder (no extra escaping)

Image

Ultimately in one of these cases, I would like the left-hand side to have a copyable string without escaping of ", and in the right-hand side it still be shown nicely in the placeholder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions