This directory contains the OpenAPI specification for the HyperFleet API, fetched from the official hyperfleet-api repository.
The openapi.yaml file is automatically downloaded during make generate from:
- Repository: https://github.com/openshift-hyperfleet/hyperfleet-api
- Default ref: main (configurable via
OPENAPI_SPEC_REF) - File:
openapi/openapi.yaml
Important: The openapi.yaml file is NOT committed to git. It is downloaded fresh on every make generate to ensure you're always using the official specification.
To generate the Go client from the latest OpenAPI spec:
make generateThis will:
- Download
openapi.yamlfrom hyperfleet-api (main branch by default) - Generate Go client code in
pkg/api/openapi/ - Format the generated code
Important: Generated files in pkg/api/openapi/ are also NOT committed to git. They must be regenerated locally during development.
To use a specific branch or tag:
# Use a specific tag
make generate OPENAPI_SPEC_REF=v1.0.0
# Use a different branch
make generate OPENAPI_SPEC_REF=develop
# Use a commit SHA
make generate OPENAPI_SPEC_REF=abc123You can also set it as an environment variable:
export OPENAPI_SPEC_REF=v1.0.0
make generate- Tool: OAPI Codegen
- Language: Go
- Output:
pkg/api/openapi/(not committed to git) - Go-based: Uses oapi-codegen to generate go types
- Wrapper:
internal/client/client.goprovides a simplified interface to the generated client
The generator configuration follows the same pattern as rh-trex.
When the hyperfleet-api repository is updated:
- Run
make generate(ormake generate OPENAPI_SPEC_REF=<ref>) to download the spec and regenerate the client - Update
internal/client/client.gowrapper if needed to support new endpoints/models - Run tests to ensure compatibility:
make test
By default, the spec is fetched from the main branch. Use OPENAPI_SPEC_REF to pin to a specific version.