Importing gRPC API Definitions

You can upload your existing gRPC API definitions to Swagger Studio by importing .proto files. The imported definitions are read-only and searchable in your organization's API catalog.

Swagger Studio supports the Proto3 syntax. Proto2 files and Protobuf Editions (2023 and 2024) are not currently supported.

Import a gRPC definition

Note

Swagger Studio supports the import of single-file .proto definitions. Currently, files that reference external .proto dependencies may not resolve correctly.

To import a GraphQL definition using the Swagger Studio interface, perform the following steps:

  1. On the Swagger Studio landing page, select the Import API tile.

    Alternatively, click Create New in the left sidebar and select Import and Document API.

  2. In the Import API dialog,select the .proto file you want to import. You can do that by either dragging and dropping it into the upload area or clicking browse to choose it from your local device. Alternatively, enter a source URL in the input field and click Next to proceed.

    Studio_screenshot_import_api_01.png

    The system validates the selected input as a correct Proto3 .proto file.

  3. In the subsequent dialog, fill out the fields:

    • Name – The API name is its unique ID and is part of its path on Swagger Studio, as in https://app.swaggerhub.com/api/{owner}/petstore/1.0. Requirements:

      • 3 to 60 character long

      • Allowed characters: A..Z a..z 0..9 - _ .

      • Must start and end with a letter or digit

      Note that API names are case-sensitive, so petstore and PetStore are two different APIs.

      Tip

      By default, Swagger Studio autocompletes the Name field based on the info.name value that is included in the collection you are importing. If that value does not exist, the name of the imported API is set to your-api.

  4. Click Import.

  5. (Optional.) If the name you selected for the imported GraphQL collection is already in use, you can either overwrite the existing definition or save the imported one as a new version.

    Studio_screenshot_import_api_03.png

The system validates the provided details and imports the file. You are navigated to the preview of the imported gRPC definition.

Browse gRPC definitions

The imported gRPC files are listed in your organization's My APIs page. In the main catalog, you can view the following attributes of these definitions:

  • Name

  • Resource type

  • Specification type

To easily navigate to your gRPC APIs, enter their attributes in the search field.

Similar to other API specifications, you can also add gRPC definitions to your organization's projects.

View a gRPC definition

After importing a gRPC definition or navigating to it from your organization's catalog, the API is displayed in the editor in the read-only view. You can preview the services, RPC methods, and message types defined in the .proto file.

Note that Swagger Studio does not support this API format's edition.

Publication date: