Most files in the project are autogenerated by swagger-codegen.
- template - folder contains redefined templates of
swagger-codegen
. Original templates you can find in swagger-codegen repo. - docs - generated documentation for models and API Client.
- sdk - API Client code - partialy generated by swagger.
You need swagger-codegen
to run code generation. There are many ways described in the readme.
In the project we use local jar file swagger-codegen-cli.jar
.
You can just run go run generate.go
script and it will do all the work.
To download fresh OpenAPI schema run ./sync.sh
.
Swagger generates models and API service interface for us, which we then implement manually. You can check ./sdk/api_fingerprint.go and ./sdk/api_fingerprint_impl.go for examples.
Project configuration is described in config.json
file. To read about available parameters run the command below:
java -jar ./bin/swagger-codegen-cli.jar config-help -l go
Tests are located in tests.
To run tests you can use IDE instruments or just run:
cd test && go test
Go inside the example
folder to test API requests using the local version of the SDK. The example/go.mod file reroutes the SDK module references inside example
to its parent folder.
Create an .env
file inside the example
folder according to example.env.
Run the scripts like this:
cd example
go run getEvent.go
go run getVisits.go
We use changesets for handling release notes. If there are relevant changes, please add them to changeset via pnpm exec changeset
. You need to run pnpm install
before doing so.