Skip to content

registry upload csv

Tim Burks edited this page Jan 26, 2023 · 5 revisions

The registry tool includes an opinionated uploader that imports API descriptions into the registry using a CSV that includes paths to local API description files, typically in the OpenAPI format.

The uploader makes these assumptions:

  • All API specs are stored on the local filesystem and in the same directory as the CSV file.

  • The CSV file has four columns. These can be in any order, but should follow the structure described by the first line, which should contain the values shown in the example below.

api_id,version_id,spec_id,filepath
cloudtasks,v2beta2,openapi.yaml,testdata/csv/cloudtasks/v2beta2/openapi.yaml
cloudtasks,v2,openapi.yaml,testdata/csv/cloudtasks/v2/openapi.yaml
datastore,v1beta1,openapi.yaml,testdata/csv/datastore/v1beta1/openapi.yaml
datastore,v1,openapi.yaml,testdata/csv/datastore/v1/openapi.yaml
  • the uploader is currently hard-coded to specify a mimetype of application/x.openapi+gzip;version=3.0.0 for all API specs, and all specs are automatically gzipped before they are uploaded.

The upload command is as follows:

registry upload csv $FILE