README: expand documentation of code generation

This commit is contained in:
Sybren A. Stüvel 2022-05-20 10:49:37 +02:00
parent a74ad07642
commit 79c632bc9f

@ -55,16 +55,28 @@ using `localhost`, and if you're not testing on `localhost` this stands out
more.
## Generating the OpenAPI/Swagger API
## Generating Code
Some code is generated from the OpenAPI specs in
`pkg/api/flamenco-openapi.yaml`. The generated code is committed to Git, so that
after a checkout you shouldn't need to re-run the generator to build Flamenco.
Some code (Go, Python, JavaScript) is generated from the OpenAPI specs in
`pkg/api/flamenco-openapi.yaml`. There are also Go files generated to create
mock implementations of interfaces for unit testing purposes.
The JavaScript and Python generator is made in Java, so it requires a JRE/JDK to
Generated code is committed to Git, so that after a checkout you shouldn't
need to re-run the generator to build Flamenco.
The JavaScript & Python generator is made in Java, so it requires a JRE/JDK to
be installed. On Ubuntu Linux, `sudo apt install default-jre-headless` should be
enough.
The following files & directories are generated. Generated directories are
completely erased before regeneration, so do not add any files there manually.
- `addon/flamenco/manager/`: Python API for the Blender add-on.
- `pkg/api/*.gen.go`: Go API shared by Manager and Worker.
- `internal/**/mocks/*.gen.go`: Generated mocks for Go unit tests.
- `web/app/src/manager-api/`: JavaScript API for the web front-end.
## OpenAPI Commit Guidelines
Typically a change to the OpenAPI definition consists of three steps, namely