Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Add HTTP annotations #696

Closed
david4096 opened this issue Aug 23, 2016 · 0 comments
Closed

Add HTTP annotations #696

david4096 opened this issue Aug 23, 2016 · 0 comments
Assignees

Comments

@david4096
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants