Skip to content

Add support for json.Number#82

Open
kpacha wants to merge 2 commits into
jmespath:masterfrom
kpacha:json_number
Open

Add support for json.Number#82
kpacha wants to merge 2 commits into
jmespath:masterfrom
kpacha:json_number

Conversation

@kpacha

@kpacha kpacha commented Mar 9, 2023

Copy link
Copy Markdown

Closes #27 and #63

@Gale-Zhang

Gale-Zhang commented Mar 13, 2025

Copy link
Copy Markdown

Hi! I have a self test with your branch and find that base operators(>, <, = ...) still not support json.Number. Following is a case:

jmespath:

sum(Stats[?Value>`1`].Value)

jsonData:

{
    "Stats":
    [
        {
            "ValueFloat": 1,
            "Interval": 9,
            "ItemType": 1,
            "Item": "123",
            "TimeSlot": "2025-01-01",
            "Value": 1
        },
        {
            "ValueFloat": 1,
            "Interval": 9,
            "ItemType": 1,
            "Item": "456",
            "TimeSlot": "2025-01-02",
            "Value": 3
        },
        {
            "ValueFloat": 1,
            "Interval": 9,
            "ItemType": 1,
            "Item": "789",
            "TimeSlot": "2025-01-03",
            "Value": 1
        }
    ],
    "DataReadyStatus":
    [],
    "Versions":
    [
        1
    ],
    "BaseResp":
    {
        "StatusMessage": "success",
        "StatusCode": 0
    }
}

the result is 0, which seems that all items have been filterred due to json.Number > operation

@Jamica-byte

Copy link
Copy Markdown

Closes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

json.Number format is not supported

3 participants