This directory contains the definitions of Protocol Buffers used by SpiceDB.
Buf is used to lint and distribute these definitions and generate source code from them.
- The
version
field found in various buf YAML configuration is actually schema of the YAML of the file and is not related to the version of the definitions. buf build
andbuf generate
do entirely different things. Building compiles definitions and ensures semantic validity. Generate builds and then produces actual source code according tobuf.gen.yaml
.
All of the following commands can be done at the root of the project thanks to the buf.work.yaml
file.
Edit the various .proto
definition files and run the following to validate them:
buf build && buf lint
Once valid and ready to be used in source code, you can generate code by executing buf.gen.yaml
:
./buf.gen.yaml