infinum / Japx

Lightweight parser for the complex JSON:API (http://jsonapi.org/) structure.
MIT License
153 stars 35 forks source link

handle IDs that are numbers #16

Closed gtchance closed 5 years ago

gtchance commented 5 years ago

If the ID value is a number, the casting to a String fails.

lokakien commented 5 years ago

From https://jsonapi.org/format/#document-resource-object-identification:

The values of the id and type members MUST be strings.

Truba commented 5 years ago

Hi guys,

@lokakien is correct that id must be string. With that said, we are not against this PR, since adding some additional robustness is usually a good thing. The only concern we have with this PR is a possible drop in performance.

We are currently devising a way to benchmark this.

andrewtheis commented 5 years ago

Any update on this @Truba ? We need this support as well.