Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> advice to "always" treat numbers as strings

FFS, have your parser fail on inputs it can not handle.

Anyway, the book defining XML doesn't tell you how your parser will handle values you can't represent on your platform either. And it also won't tell you how our parser will read timestamps. Both are completely out of scope there.

The only common issue in JSON that entire book covers is comments.

The SOAP specification does tell you how to write timestamps. It's not a single book, and doesn't cover things like platform limitations, or arrays. If you want to compare, OpenAPI's spec fills a booklet:

https://swagger.io/docs/specification/v3_0/about/



> FFS, have your parser fail on inputs it can not handle.

I wish browser developers would understand that.

    JSON.parse("9007199254740993") === 9007199254740992




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: