Go API clients for the Genome Nexus public and internal APIs, generated with OpenAPI Generator.
genome-nexus-public-api/— client for the public API (spec:genome-nexus-public-api/api/openapi.yaml)genome-nexus-internal-api/— client for the internal API (spec:genome-nexus-internal-api/api/openapi.yaml)templates/go/— custom Mustache templates used to override the defaultgogenerator output
The clients are generated with the openapi-generator-cli go generator, using the custom templates in templates/go/ (via -t) so that generated code differs from stock output — e.g. model_simple.mustache omits the decoder.DisallowUnknownFields() call so clients tolerate unknown/unrecognized response fields instead of failing to unmarshal.
-
Install
openapi-generator-cliand pin it to the generator version recorded in that client's.openapi-generator/VERSION(7.13.0forgenome-nexus-public-api):npm install @openapitools/openapi-generator-cli -g openapi-generator-cli version-manager set 7.13.0 -
Edit the OpenAPI spec (
api/openapi.yaml) for whichever client you're updating, and/or edit the templates intemplates/go/. -
Regenerate, pointing at the custom templates:
openapi-generator-cli generate \ -i genome-nexus-public-api/api/openapi.yaml \ -g go \ -o genome-nexus-public-api \ -t templates/go \ --package-name genome_nexus_public_api
Swap the
-i,-o, and--package-namevalues forgenome-nexus-internal-apito regenerate that client instead (check its own.openapi-generator/VERSIONfirst, since it may differ). -
Review the diff — the generator will rewrite all files not listed in that directory's
.openapi-generator-ignore. Discard any unwanted changes (e.g. accidentalgo.modregeneration) before committing. -
Build to confirm the regenerated client still compiles:
cd genome-nexus-public-api && go build ./...