-
Notifications
You must be signed in to change notification settings - Fork 232
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
Associated Trip Fix #202
Associated Trip Fix #202
Conversation
…ired if applicable instead of optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a huge fan of this change (not surprisingly). I have one JSON schema question, otherwise this lgtm!
@@ -300,6 +300,28 @@ | |||
} | |||
} | |||
], | |||
"anyOf": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just anyOf
instead of oneOf
because you can't specify oneOf
twice for the same object? Not to get too far into the weeds, but wouldn't it be more semantically correct to structure this whole sub-schema as a single allOf
with three sub-schemas: 1. the current oneOf
defined above for valid event_type
and event_type_reason
combinations
2. this, as a oneOf
, defining when associated trips
is required
3. the rest of the properties, defined below.
More specifically, this would look like (non-relevant intermediate lines omitted for brevity):
"items": {
"$id": ...,
...
"required": [...],
"allOf": [
{ "oneOf": [ "schema_for_valid_event_types_and_reasons" ] },
{ "oneOf": [ "this_schema_for_associated_trip" ] },
{ "properties": "...properties listed below...." }
]
}
(caveat this is the first time I've read the JSON schema spec closely, so take this with a dose of skepticism/it may be way wrong)
@@ -300,6 +300,28 @@ | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also just realized - this file is auto-generated. I believe the one you want to change is https://github.com/CityOfLosAngeles/mobility-data-specification/blob/dev/generate_schema/provider/status_changes.json
Closing as this is supplanted in #217. |
This breaking change addresses #88 for the
associated_trip
field in thestatus_changes
endpoint.Changes: