ga4gh / ga4gh-server

Reference implementation of the APIs defined in ga4gh-schemas. RETIRED 2018-01-24
http://ga4gh.org
Apache License 2.0
96 stars 93 forks source link

Frontend refactor #1540

Open david4096 opened 7 years ago

david4096 commented 7 years ago

The frontend.py could be made more modular by moving the routes to another file as shown here.

Ideally, the schemas themselves offer the routes and handler relationships needed to instantiate a server as shown in https://github.com/david4096/ga4gh-node-server .

It should be possible using the current schemas to dynamically generate the front end routes. Barring that, we should at least move the routes to their own module.

david4096 commented 7 years ago

I took a look at the compiled protobuf and it seems like the http annotation options are only in the serialized file descriptor. (Search for a9 in this file https://github.com/ga4gh/schemas/blob/master/python/ga4gh/schemas/ga4gh/metadata_service_pb2.py)

I expect them in the descriptor options of the generated message. This might be a problem with the protoc python generator, or how they are being used.

Another good route is a module like https://github.com/gangverk/flask-swagger . It lets you annotate the endpoints using YAML that generates a swagger spec.