ga4gh / ga4gh-schemas

Models and APIs for Genomic data. RETIRED 2018-01-24
http://ga4gh.org
Apache License 2.0
214 stars 114 forks source link

Add HTTP annotations #696

Closed david4096 closed 7 years ago

david4096 commented 8 years ago

There is an API for describing HTTP endpoints that will make this data programmatically available to consumers of the protobuf descriptors. This means the schemas can deprecate the usage of inline comments to describe the HTTP endpoints for a protocol.

For example:

  // `POST /biosamples/search` must accept a JSON version of
  // `SearchBioSamplesRequest` as the post body and will return a JSON version
  // of `SearchBioSamplesResponse`.
  rpc SearchBioSamples(SearchBioSamplesRequest)
      returns (SearchBioSamplesResponse);

...becomes...

  // `POST /biosamples/search` must accept a JSON version of
  // `SearchBioSamplesRequest` as the post body and will return a JSON version
  // of `SearchBioSamplesResponse`.
  rpc SearchBioSamples(SearchBioSamplesRequest)
      returns (SearchBioSamplesResponse) {
      option (google.api.http) = {
        post: "/v0.6.6a/biosamples/search"
        body: "*"
      };
    };

This makes it easier to develop server and clients as the endpoint information is readily available via the inclusion of Google's http annotations proto.