egbakou / RESTCountries.NET

⚡Offline dotnet standard library to get information about countries
https://lioncoding.com
MIT License
287 stars 19 forks source link

[feature]: add support for country states #23

Open egbakou opened 1 year ago

egbakou commented 1 year ago

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

donprecious commented 1 year ago

Hello, i would like to pick up this feature.

egbakou commented 1 year ago

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

donprecious commented 8 months ago

@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 commented 8 months ago

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