snyk-go-client
A partially auto-generated Go client for the Snyk REST API.
Installation
First install go-swagger and api-spec-converter:
brew tap go-swagger/go-swagger
brew install go-swagger
npm install -g api-spec-converter
Generation
Open https://apidocs.snyk.io/ and copy the date of the latest OpenAPI spec.
Download using (replace the date as needed):
curl -o openapi.json https://api.snyk.io/rest/openapi/2024-01-23
api-spec-converter -f openapi_3 -t swagger_2 openapi.json > swagger.json
swagger generate client --skip-validation -f swagger.json
You may need to modify the auto generated files before the swagger generate client
call.