Skip to content

registry upload discovery

Tim Burks edited this page Jan 21, 2023 · 3 revisions

The registry tool includes an opinionated uploader that imports API descriptions in the Google API Discovery Service format. It is designed to import API descriptions from the Google API Discovery Service but could be modified to work with other API descriptions stored in a similar structure (the Discovery Service endpoint is currently not configurable).

The uploader makes these assumptions:

  • All API descriptions are stored remotely on the Google API Discovery service and can be listed with the list operation and can be fetched from the URL specified in the discoveryRestUrl field of each listing.

  • The API and version ids are derived from the name and version fields of the listing, possibly "sanitized" to match style expectations.

The upload command is as follows:

registry upload discovery --project-id $PROJECTID

This is a "bulk" uploader; it will upload every API spec that is listed by the Discovery Service.

With these API descriptions stored in the registry, we can run linters and other tools by reading API specs from the registry, analyzing them, and putting the results back in the registry. Since each API spec is independent and fully-resolved, these tools can run concurrently and in a distributed way.