SpaceApi / schema

SpaceAPI JSON schema files.
24 stars 14 forks source link

Add country_code to location #108

Closed dbrgn closed 2 months ago

dbrgn commented 2 months ago

Add an ISO-3166 alpha-2 country code to the location object.

Note: One could argue that - since the location becomes optional with #106 - the country code can be used for umbrella organizations and spaces without fixed location as well and should be outside of the location key. On the other hand, the same thing county for the time zone, so I decided to stick with location.

Resolves #74.

dbrgn commented 2 months ago

Can we have location with just the country code set? Then this point would be solved.

We could think about that. In #106, we made the entire location field optional. Instead of, or in addition to that, we could make lat/lon optional. This would mean that you could have a location with an address set, but without coordinates.

But let's discuss that in a dedicated issue. (Edit: https://github.com/SpaceApi/schema/issues/112)

Another thing: Should we validate the country code? We could sanity check lon/lat with it for example.

Yeah, wouldn't hurt to add that to the validator UI: https://github.com/spaceapi-community/validator-web/issues/3

(Note: The lat/lon check you're probably thinking of is only part of the web UI, not the validator API.)