Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Employee Postcode not an integer #16

Open
mattv-ais opened this issue Jan 18, 2021 · 2 comments
Open

Employee Postcode not an integer #16

mattv-ais opened this issue Jan 18, 2021 · 2 comments

Comments

@mattv-ais
Copy link

mattv-ais commented Jan 18, 2021

The API defines this as an integer however it seems that one of our client schools is able to enter 'TBA' into the postcode field.

image

image

This causes our JSON parsing to break. An easy fix fortunately but thought I'd mention.

@jtc
Copy link

jtc commented Jan 18, 2021

I've found that the API returns any numeric string as a JSON integer if there are no non-numeric characters, it doesn't start with 0, and its value is 2137483646 or lower. Can't remember what the deal is with negative numeric strings or decimals.

So until the API returns JSON types in line with the DB types, beware that either strings or integers may be returned for almost any field.

EDIT: linking this issue with TheAlphaSchoolSystemPTYLTD/api-introduction#9

@mattv-ais
Copy link
Author

Gotcha, thanks @jtc . The second screenshot is from the documentation on Github. I've already changed our code to treat it like a String instead of an Integer but figured I'd mention as the pojos were generated based on the example json ( https://github.com/TheAlphaSchoolSystemPTYLTD/employee-hr/blob/master/getEmployeesDetails.md - Success Response) and others may come across this.

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

No branches or pull requests

2 participants