plantbreeding / IPK-BrAPI-Validator

MIT License
4 stars 3 forks source link

generated schema and tests for v1.3 #31

Closed BrapiCoordinatorSelby closed 5 years ago

BrapiCoordinatorSelby commented 5 years ago

@martinbaste @langeipk @patrick-koenig Not sure who should review/deploy this. Do I need to add Mehmood?

Let me know if you have questions

patrick-koenig commented 5 years ago

Hi Pete,

first: Mehmood does not have a Github account yet and is currently not working on BRAVA.

Thank you very much for your contribution and the invested time!

I've merged your changes and updated our running BRAVA instance at http://webapps.ipk-gatersleben.de/brapivalidator/ to this latest version.

Can you tell us something about the automated creation of the collections and schema files? So how do you create the schema files based on the OpenAPI 3.0 specification files (yaml)? Did you use this Python script you proposed some months ago?

Another important question is how we deal with the several versions for the scheduled automated tests of all registered BrAPI ressources (startpage)? How to derive the version of an endpoint if no versions supplied in the /calls resource?

BrapiCoordinatorSelby commented 5 years ago

Can you tell us something about the automated creation of the collections and schema files? So how do you create the schema files based on the OpenAPI 3.0 specification files (yaml)? Did you use this Python script you proposed some months ago?

I wrote this python script to generate the test files: https://github.com/plantbreeding/API/blob/master/Scripts/buildJSONSchema.py

I kept it in the API repo because it references some other scripts I have written previously for manipulating the BrAPI documentation. The models in the OpenAPI 3 YAML files are already in a compatible JSON Schema format, and YAML can be directly converted to JSON.

I did not get a chance to add many comments to the script, so it is still a bit messy, but if you have the API repo checked out you should be able to run it yourself.

Another important question is how we deal with the several versions for the scheduled automated tests of all registered BrAPI ressources (startpage)? How to derive the version of an endpoint if no versions supplied in the /calls resource?

Yes I have put a little thought into this. The 'versions' array was added to the /calls endpoint in v1.2, so if there is no version information, I think we can assume v1.1 (I haven't heard of anyone with an active 1.0 implementation). But there is a very real possibility that some people will have servers with multiple versions present, so there will need to be some minor UI redesign and backend refactoring to be able to handle testing multiple collections against one server.

I don't have time to work on this problem right now, but there are 2 big enhancements to BRAVA I am eager to work on in the near future: The versioning issue you mentioned, and adding OAuth capability.