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

student_code is an integer in some TASS instances and string in others #71

Open
team-hq opened this issue Sep 24, 2024 · 1 comment
Open
Labels

Comments

@team-hq
Copy link

team-hq commented Sep 24, 2024

Hi guys,

I found that most TASS instances return "student_code" as string, but the latest instance I'm working on returns it as an int. This one is on tass.cloud and I think the others are on-prem.

params = "{'currentstatus': 'current'}"
method = "getStudentsDetails"
version = "3"

These are 6 digit numbers starting with 1 and the others are also 6 digit numbers but they start with 00.

Let me know if you need more info.

I'll cast it to a string and save, but maybe just letting you know and letting others know as I've spent a considerable amount of time on finding this inconsistency.

Cheers,

M

@scottetass
Copy link
Contributor

Hi,

Thanks for bringing this to our attention.

I suspect it's because the API does not use pre-defined models to let the JSON serialiser know what each field type is, so it probably tries to make a best-case guess of the field type based on the data in each field. The fields starting with 1 can definitely be determined as a number whereas the fields starting with leading zeroes can't be determined as a real number because numbers don't generally start with leading zeroes, so it assumes it's a string.

I'm not sure what can be done about it, I'll speak to the ColdFusion gurus and see if we can improve this in some way.

Thanks, Scott

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants