RESTCountries.NET
RESTCountries.NET copied to clipboard
[feature]: add support for country states
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
Hello, i would like to pick up this feature.
@donprecious Sure, you can take on this feature :)
@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
@donprecious Could you please use a separate dataset? Just make sure that the 'countryCode' fields come from the existing dataset.