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

Agency schema #172

Closed
Closed

Conversation

ian-r-rose
Copy link
Contributor

@ian-r-rose ian-r-rose commented Nov 8, 2018

Fixes #169. Partial fix for #168.

I have tried to hew as closely as I could to the description in the README, with a couple of exceptions for things I thought were mistakes or unclear:

  • Should reason_code in the update vehicle status API instead be the same as event_type_reason from the status_change API? It seemed to me that it should from the narrative description.
  • I have gone ahead and changed several of the points to be MDS_Feature_Points as suggested in [agency] Consider using GEOJSON features #168.
  • vehicle_type and propulsion_type seemed out of sync with the provider API. I updated them.

These schema are as yet not very well tested, and I am not aware of any synthetic data to put them through the works. Do you have anything you could point me towards @hunterowens or @thekaveman?
Finally, I notice that the spec does not include version fields in them, as is the case for provider. Should we consider adding that?

I have not added schema for any of the agency response types at the moment.

@ian-r-rose
Copy link
Contributor Author

Ooh, I see this will conflict with #161. Happy to deal with those conflicts however you see fit.

@hunterowens
Copy link
Collaborator

We'll have to rebase and redo this after #194

Let's hold off on doing this until #195 #196 and #197 are done.

@hunterowens hunterowens added the Agency Specific to the Agency API label Dec 20, 2018
@marie-x
Copy link
Collaborator

marie-x commented Feb 2, 2019

Still waiting on #197, yes?

@hunterowens
Copy link
Collaborator

@karcass yes, and #203 if we go that route.

@hunterowens
Copy link
Collaborator

that being said, I don't think it would be a bad idea to get JSON schema definitions of the expected return values for an Agency API for now. We can ignore the /service_areas endpoint.

@marie-x
Copy link
Collaborator

marie-x commented Feb 4, 2019

Agreed, let me put a schema on the agency to-do list. It should be super simple. Register just reads back the vehicle it got, and /event and /telemetry basically just say "got it, thanks!" :)

@hunterowens
Copy link
Collaborator

hmm yeah.

perhaps it is a good idea to have valid schema definitions for both the inputs and outputs for an Agency API. Ie, what is valid to submit / and recieve.

To utilize the common datatype, you can see how we generate the official schemas in generate_schema/generate_provider_schema.py @ian-r-rose may be able to provide additional direction.

@marie-x
Copy link
Collaborator

marie-x commented Feb 4, 2019

I will likely require some guidance to be efficient / effective.

@hunterowens
Copy link
Collaborator

@karcass quick question - you guys did swagger / openAPI specs for the reference implementation, or I am not remembering that correctly.

@marie-x
Copy link
Collaborator

marie-x commented Feb 4, 2019

@hunterowens I'm evaluating options. Swagger seems like it's more suited for start-with-swagger (code generation etc.) rather than bolt-on-afterwards, and I didn't start with it. I am tentatively leaning towards using apidoc to extract my JavaDoc-style comments in the ref impl into doc files. Do you strongly favor swagger, is apidoc (or similar) acceptable?

@toddapetersen
Copy link
Contributor

Closing this as the PR is no longer inline with the latest version of Agency spec. We will revisit the issue (#169 ) to generate a schema once the Agency sandbox evaluation period has wrapped up.

@hunterowens hunterowens reopened this Feb 5, 2019
@hunterowens
Copy link
Collaborator

@toddapetersen I'd prefer to keep this open, as getting a formally definition of the schema, rather than a written version, is pretty critical.

@marie-x
Copy link
Collaborator

marie-x commented Feb 5, 2019

@hunterowens we will open a separate PR for that. This PR is out of date. We left the issue open for tracking.

@ian-r-rose
Copy link
Contributor Author

I'm happy to update this once you feel like outstanding changes to the agency spec have been resolved (#197, #203, perhaps others?). Do you have any comments on my questions above, especially regarding status_change?

We may also want to migrate to openapi, as suggested above, though my inclination is to do things one-at-a-time.

@marie-x
Copy link
Collaborator

marie-x commented Feb 5, 2019

@ian-r-rose If you're offering to do part of my job for me, I graciously accept! I didn't think it was fair for us to rejigger everything and have you keep chasing a moving target.

Yes, agency has deliberately reframed event_type and event_type_reason as state and event_type. I apologize for the confusion, and I'm not sure how to fully reconcile agency and provider (and at present, perfect alignment is not a hard requirement). In the context of the agency API, we (various E&A folks, coding the first agency implementation) reached the conclusion that a state-machine representation of edges (events) and nodes (states) was closer to the ground-truth of what we were trying to capture. So, that's where we're at.

Happy to answer any additional questions.

@marie-x
Copy link
Collaborator

marie-x commented Feb 12, 2019

@ian-r-rose do you plan to update this PR?

@hunterowens hunterowens added this to the 0.3.0 milestone Feb 12, 2019
@hunterowens hunterowens modified the milestones: 0.3.0, 0.3.1 Feb 12, 2019
@ian-r-rose ian-r-rose mentioned this pull request Feb 13, 2019
@ian-r-rose
Copy link
Contributor Author

Closing in favor of #238

@ian-r-rose ian-r-rose closed this Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agency Specific to the Agency API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON Schema for Agency
4 participants