Skip to content

JSON query mismatch between v1 and v2. jsonata.org not fully supported #6277

@twl9

Description

@twl9

After upgrading 10+ monitors turned red. What caused this? Incorrect jsonata parsing.

Monitors turn red with "Error evaluating JSON query: The post-JSON query evaluated response from the server is of type object, which cannot be directly compared to the expected value. Response from server was: [true]" message

👟 Reproduction steps

https://try.jsonata.org/ with the data from https://docevent.instatus.com/v2/components.json and the expression "components[id='ckphsjmoj2164539voqw574wdrf'].[status='OPERATIONAL']" turns true, but a monitor with this expression and true as expected condition result in the message above. Or

{ "data": [ { "status": "ready", "storage_info": { "used_percentage": 14 } } ] }

with "$.data.[status = 'ready' and storage_info.used_percentage < 75]" return the same error.

👀 Expected behavior

Condition work identical to playground of jsonata

😓 Actual Behavior

Condition work different then the playground of jsonata

🐻 Uptime-Kuma Version

2.0.2

💻 Operating System and Arch

Pikapods

🌐 Browser

Chrome

🖥️ Deployment Environment

NA

📝 Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions