Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Associated Trip Fix #202

wants to merge 1 commit into from

Conversation

black-tea
Copy link
Contributor

This breaking change addresses #88 for the associated_trip field in the status_changes endpoint.

Changes:

  • Clarifies that associated trip is singular, not plural in provider README.md
  • Modifies field name (associated_trips -> associated_trip) in JSON Schema and README.md
  • Modifies JSON Schema from optional to required if applicable using implication logic
  • Modifies JSON Schema type from array of UUIDs to single UUID

@black-tea black-tea added Provider Specific to the Provider API Schema Implications for JSON Schema or OpenAPI labels Dec 28, 2018
@black-tea black-tea added this to the 0.3.0 milestone Dec 28, 2018
Copy link
Contributor

@oderby oderby left a 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": [
Copy link
Contributor

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 @@
}
Copy link
Contributor

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

@hunterowens
Copy link
Collaborator

Closing as this is supplanted in #217.

@hunterowens hunterowens closed this Feb 4, 2019
@hunterowens hunterowens mentioned this pull request Feb 14, 2019
@hunterowens hunterowens deleted the associated-trip-patch branch June 13, 2019 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Provider Specific to the Provider API Schema Implications for JSON Schema or OpenAPI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants