Closed OrangeDrangon closed 1 month ago
Ah yeah, i see - that's because of the fact the character is a deleted character, so i can't update the data for it.
The name IS the numbers tho, so if you can handle casting it to a string then it should be accurate :)
I would assume for consistency the api would return "NUM" instead of NUM. But it can definitely be handled on the client end if you do not want to mess with it.
Problem is it's correct in my DB, it's when i use the $this->json(..) output in the controller that it happens 😅
So if you can just assume name is always a string on your end, that'd solve the problem, otherwise i gotta revamp my json encoder class to solve it
The problem is https://www.php.net/manual/en/json.constants.php#constant.json-numeric-check set in https://github.com/EVE-KILL/Killboard/blob/b98a51f7c5557c8d265ec33eff9961cc55d78fee/src/Api/Abstracts/Controller.php#L303C37-L303C48
When you read it out of the database it is a string but when you serialize it it gets auto converted to an int. I assume this is because you have other data that needs the flag in the database?
You're right, lets try and remove that and see what it does 😂
https://eve-kill.com/api/characters/90003455
Looks correct now - neato, and nothing seems to be broken either
Describe the bug If you query the id 90003455 from the character api the name field is an int instead of string.
To Reproduce Steps to reproduce the behavior: Any API request will do:
Expected behavior Stringify the value.
Additional context Occurs on the post endpoint and the get endpoint. Probably stored in the backend database that way if I had to guess.