Thank you for your interest in contributing! This document covers the development workflow for the Template-specific API specification.
- Node.js 20.x or later
- npm 11.6.2 or later
- Git
-
Clone the repository:
git clone https://github.com/openshift-hyperfleet/hyperfleet-api-spec-template.git cd hyperfleet-api-spec-template -
Install dependencies (includes the TypeSpec compiler and the
hyperfleetshared package):npm install
-
Verify your setup:
npm run build
hyperfleet-api-spec-template/
├── main.tsp # Main TypeSpec entry point
├── tspconfig.yaml # TypeSpec compiler configuration
├── build-schema.sh # Build script
├── models/ # Template-specific models
│ ├── cluster/ # TemplateClusterSpec
│ ├── nodepool/ # Template nodepool models
│ ├── channel/ # Channel model
│ └── version/ # Version model
├── services/ # Template-specific service endpoints
│ ├── channels.tsp
│ └── versions.tsp
└── schemas/template/ # Generated OpenAPI output (committed)
├── openapi.yaml # OpenAPI 3.0
└── swagger.yaml # OpenAPI 2.0 (Swagger)
Shared models and services are imported via the hyperfleet npm package from hyperfleet-api-spec.
npm run build # OpenAPI 3.0
npm run build:swagger # OpenAPI 3.0 + Swagger 2.0npx spectral lint schemas/template/openapi.yamlls -l schemas/template/openapi.yaml schemas/template/swagger.yamlEdit the relevant file in models/ (e.g., models/cluster/model.tsp) and rebuild:
npm run build-
Create the service file in
services/:// services/newservice.tsp import "@typespec/http"; import "@typespec/openapi"; import "../models/common/model.tsp"; namespace HyperFleet; @route("/new-resource") interface NewService { @get list(): NewResource[] | Error; }
-
Import in
main.tsp:import "./services/newservice.tsp";
-
Build and verify:
npm run build
When a new version of the core repo is released, update package.json:
"hyperfleet": "github:openshift-hyperfleet/hyperfleet-api-spec#v1.0.19"Then run npm install and rebuild.
Please refer to the architecture repo commit standard.
Examples:
feat: add channelGroup to ReleaseSpec (Template-696)
fix: correct required fields in ChannelSpec
docs: update README with new endpoint examples
Releases are fully automated. See RELEASING.md for details.
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Build:
npm run build(andnpm run build:swaggerif needed) - Commit with a conventional commit message
- Open a Pull Request
- Address review feedback
- Include schema outputs in commits when they change
- Update
CHANGELOG.mdwith your changes under[Unreleased] - Reference related issues or JIRA tickets in the PR description