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

[feature]: add support for country states #23

Open
egbakou opened this issue Feb 28, 2023 · 4 comments
Open

[feature]: add support for country states #23

egbakou opened this issue Feb 28, 2023 · 4 comments
Labels
enhancement New feature or request feature help wanted Extra attention is needed

Comments

@egbakou
Copy link
Owner

egbakou commented Feb 28, 2023

To update the dataset, create a new file named "states.json" and save it in the /src/RESTCountries.NET/Services directory. The JSON structure of the file should be as follows:

[
  {
    "countryCode": "country code",
    "states": [
      {
        "name": "State name",
        "cities": [
          "Cities in this state"
        ]
      },
      {
        "name": "Another State name",
        "cities": [
          "Cities in this state"
        ]
      }
    ]
  },
  {
    "countryCode": "another country code",
    "states": [
      {
        "name": "State name",
        "cities": [
          "Cities in this state"
        ]
      },
      {
        "name": "Another State name",
        "cities": [
          "Cities in this state"
        ]
      }
    ]
  }
]

Please ensure that the country alpha 2 code is obtained from the existing data.json file.

To simplify the process, you may automate the task using a script

@egbakou egbakou added enhancement New feature or request help wanted Extra attention is needed feature labels Feb 28, 2023
@donprecious
Copy link

Hello, i would like to pick up this feature.

@egbakou
Copy link
Owner Author

egbakou commented Oct 5, 2023

@donprecious Sure, you can take on this feature :)

@donprecious
Copy link

@egbakou i am stating this feature now. i realise including the cities in the state json will make the json file much larger, and processing time will much longer. am think we should have a different data set json for states only.
What do you think

@egbakou
Copy link
Owner Author

egbakou commented Feb 17, 2024

@donprecious Could you please use a separate dataset? Just make sure that the 'countryCode' fields come from the existing dataset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature help wanted Extra attention is needed
Projects
Status: Todo
Development

No branches or pull requests

2 participants