nlohmann / json

JSON for Modern C++

Home Page:https://json.nlohmann.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git ref got interpreted as number

juliandm opened this issue · comments

Description

i tried to parse the following object (which symbolises a git ref)

'{"ref":"6653406e8512483ea41127ccecac9197afe273fe"}'
and it apparently tried to parse the ref as a number and not as string

[json.exception.out_of_range.406] number overflow parsing '6653406e8512483'

I guess it's a very rare case because it worked multiple times before and with this specific string it failed

Reproduction steps

Parse '{"ref":"6653406e8512483ea41127ccecac9197afe273fe"}'

Expected vs. actual results

Expected result is the object with the ref attribute which is a string

Minimal code example

No response

Error messages

[json.exception.out_of_range.406] number overflow parsing '6653406e8512483'

Compiler and operating system

Linux

Library version

1800

Validation

My code was accidentally trying to parse the ref value although it was just a string.