-
Notifications
You must be signed in to change notification settings - Fork 15
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
Location: Should lat/lon be optional as well? #112
Comments
I don't think this provides much value. What's the purpose of an empty object?
I'd like that.
I don't think it should really be a blocker. |
The empty object isn't the goal in itself, but it would be an alternative form of indicating that a space has no location. The suggestion with a required "location" would mainly be that there aren't two ways to communicate the same thing. If the location can be omitted, and lat/lon are optional as well, then these two variants are equivalent in meaning: {
"location": {}, // Legal, because lat/lon are optional
} {
// Omit location completely
} With the discussion about null potentially being an allowed value, there would even be a third way to indicate the same thing (although we don't currently allow null anywhere in the v15 draft): {
"location": null,
} I generally prefer to have one right (canonical) way to represent something. Keep in mind that in v15 we're explicitly making the location key optional. The first suggestion would be to instead make the lat/lon fields optional. That's also why I marked it as release blocker, because the discussion is about potentially reverting a decision we did in the current v15 draft. (And such things are easier before the release.) |
My favored solution would be to have |
Can this be easily implemented? Sounds like quite complex validation logic to me, that probably not every consumer of the JSON schema will implement 🙂 But to keep things simple, we can simply make both lat/lon optional and keep the location key optional as well (because I also think that an empty object is a bit ugly). The vast majority of spaces will have a location anyways. |
I'd suggest to leave it as is for v15 (optional
This can then be implemented in a v16 and we could add validation that if |
I think making both the top-level location field and lat/lon optional would cover the most use cases while not introducing an empty Another thing that comes to mind: Can we specify that of one of |
I think I found a great solution: See #115 |
In #106 we made the top-level
location
field optional. If it is defined, the lat/lon fields still need to be defined though.Some virtual spaces might not have a location, but they might still have:
location.timezone
)location.country_code
, since Add country_code to location #108)location.address
, although this is being discussed in Location: Space address vs postal address #104)Maybe we should make the location required again, but allow omitting all fields?
"location": {}
Alternatively, we could keep
location
as optional, but makelocation.lat
andlocation.lon
optional as well. (Potentially with some rules to say that if one of them is defined, the other one must be defined as well.)Thoughts, @SpaceApi/core? This question is a release blocker for v15.
The text was updated successfully, but these errors were encountered: