Skip to main content

Importers

Importers are needed to fetch information about the available services and request/response types.

You can add, edit and delete importers via Project → Importers.

Import via gRPC server reflection#

Some gRPC service support server reflection. Kreya can fetch all information directly from the service itself.

Kreya currently does not store or cache the information it receives via server reflection. Each time you start Kreya, it will need to fetch it again.

Adding a gRPC importer with server reflection

Import via local protobuf files#

You can add local protobuf files. Simply change the importer type to gRPC proto files and add your files.

If you have a complex directory structure with many files, use the Add proto directories button. All protobuf files found inside the chosen directory and subdirectories are automatically imported.

Kreya only stores the relative path to the protobuf files. If you intend to share your Kreya project, make sure that the relative path to the protobuf files stays correct.

Adding a gRPC importer with local protobuf files

Import paths#

Protobuf files may import other protobuf files via relative paths. Consider the following example:

/src
/todo
todo.proto
/list
todo-list.proto (imports todo/todo.proto)

Here, the /src directory needs to be added as an import path, so that the relative path in todo-list.proto points to the correct file.

Kreya tries to guess the correct import paths. However, if you have a complex setup with multiple import paths, you may need to specify them manually.

Generating operations automatically#

For each importer, there is an option to create an operation for each API method, which is enabled by default. Each time an importer runs, Kreya will check if any of the imported methods are missing in the project. This is useful if you want to keep your operations in sync with your API. If you add a method to your API, Kreya will add an operation for it on the next importer run.