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

admin1Code, admin2Code are returned as string instead of object in API response #86

Open
shivamsaxenadev opened this issue Jul 19, 2024 · 3 comments

Comments

@shivamsaxenadev
Copy link

Hi Thomas,

Thank you for building this extremely useful application! We have been using it in our app for a few months now, and the results have been accurate 99% of the time.

I noticed that in some cases, the admin1Code or admin2Code returns a string instead of an object. Is this expected behaviour? Here are the requests to reproduce the issue:

  • "admin1Code" : "00"

curl --location 'http://SERVER_URL/geocode?latitude=-16.48679&longitude=-151.74102'

  • "admin2Code" : "00"

curl --location 'http://SERVER_URL/geocode?latitude=52.51667&longitude=13.36667'

Please let me know if you need any other information.

@tomayac
Copy link
Owner

tomayac commented Jul 22, 2024

Could you verify if this is a problem in the downloaded GeoNames raw data? The app mostly just reflects what it finds there, without much processing if I recall correctly.

@shivamsaxenadev
Copy link
Author

Hi Thomas, thank you for your response. I appreciate your input on this matter. Unfortunately, I do not have the bandwidth to investigate this further at the moment. However, since this is not currently blocking my progress, I will aim to revisit it when I have more time available in the future.

@riccardoratta
Copy link

It seems to be related to use use of the option countries: [...] in the initialisation.

When I select a specific country, e.g., "IT" only a string is returned for adminNcode while if there are no countries it works as expected.

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

3 participants