Skip to content

andreadistefano/api

 
 

Repository files navigation

OpenFGA API

This project contains the definitions of Protocol Buffers used by OpenFGA.

Buf is used to manage, package, and generate source code from the protocol buffer definitions. The API definitions are pushed to the buf.build/openfga/api repository in the Buf Registry.

Building the Generated Sources

To generate source code from the protobuf definitions contained in this project you can run the following command:

./buf.gen.yaml

The command above will generate source code in the proto/ directory.

Use the generated sources in OpenFGA

  1. Generate the sources as above
  2. In the proto directory execute the following commands:
    go mod init go.buf.build/openfga/go/openfga/api
    go mod tidy
    
  3. In OpenFGA, add the following line to your go.mod:
    replace go.buf.build/openfga/go/openfga/api => /path/to/proto
    

Generating OpenAPI Documentation

To generate the OpenAPI documentation from the protobuf sources you can run the following commands:

./buf.gen.yaml
./scripts/update_swagger.sh docs/openapiv2/apidocs.swagger.json

About

Protocol Buffers used by OpenFGA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%