{"id":50825414,"url":"https://github.com/openshift-hyperfleet/hyperfleet-api-spec-template","last_synced_at":"2026-06-13T18:05:23.887Z","repository":{"id":360654640,"uuid":"1251115239","full_name":"openshift-hyperfleet/hyperfleet-api-spec-template","owner":"openshift-hyperfleet","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-09T07:55:07.000Z","size":73,"stargazers_count":0,"open_issues_count":1,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T09:27:52.535Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeSpec","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openshift-hyperfleet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-27T08:58:24.000Z","updated_at":"2026-06-09T07:54:47.000Z","dependencies_parsed_at":"2026-05-27T11:03:30.433Z","dependency_job_id":null,"html_url":"https://github.com/openshift-hyperfleet/hyperfleet-api-spec-template","commit_stats":null,"previous_names":["openshift-hyperfleet/hyperfleet-api-spec-template"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/openshift-hyperfleet/hyperfleet-api-spec-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift-hyperfleet%2Fhyperfleet-api-spec-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift-hyperfleet%2Fhyperfleet-api-spec-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift-hyperfleet%2Fhyperfleet-api-spec-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift-hyperfleet%2Fhyperfleet-api-spec-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openshift-hyperfleet","download_url":"https://codeload.github.com/openshift-hyperfleet/hyperfleet-api-spec-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift-hyperfleet%2Fhyperfleet-api-spec-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34294416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-13T18:05:23.091Z","updated_at":"2026-06-13T18:05:23.878Z","avatar_url":"https://github.com/openshift-hyperfleet.png","language":"TypeSpec","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HyperFleet Template API Spec\n\nThis repository is a template for creating the public API contract for HyperFleet for a cloud provider.\n\nBrowse the generated contract in Swagger UI (GitHub Pages):\n\n- \u003chttps://openshift-hyperfleet.github.io/hyperfleet-api-spec-template/index.html\u003e\n\nThe public contract is different from the internal (core) one because: only contains generic API endpoints (`/resource`)\n\nThe core contract provides shared schemas for statuses, errors, pagination, etc... that are published as an NPM module that this repository adds as a dependency.\n\nThe openapi.yaml contract generated with this repo can be used to validate the request payloads on HyperFleet. E.g. this template defines an entity named `Version`, and its schema will be validated by HyperFleet API on create/update requests.\n\nBesides the OpenAPI v3 version, a `swagger.yaml` is also created to offer v2 compatibility\n\nBoth will be created by executing the build script.\n\n## Repository Structure\n\n```\nhyperfleet-api-spec-template/\n├── index.html                # Swagger UI (GitHub Pages, swagger-ui-dist 5.32.6)\n├── main.tsp                  # Main TypeSpec entry point\n├── tspconfig.yaml            # TypeSpec compiler configuration\n├── build-schema.sh           # Build script for OpenAPI generation\n├── models/                   # Template-specific model definitions\n│   ├── cluster/             # TemplateClusterSpec with Template-specific fields\n│   ├── nodepool/            # Template nodepool models\n│   ├── channel/             # ChannelSpec (is_default, enabled_regex)\n│   └── version/             # VersionSpec (raw_version, release_image, etc.)\n├── services/                 # Template-specific service endpoints\n│   ├── channels.tsp         # /channels CRUD routes\n│   └── versions.tsp         # /channels/{id}/versions CRUD routes\n└── schemas/                  # Generated OpenAPI output\n    └── template/\n        └── openapi.yaml\n```\n\nShared models and services (clusters, nodepools, statuses, resources) are imported from the `hyperfleet` npm package, which is sourced from the [hyperfleet-api-spec](https://github.com/openshift-hyperfleet/hyperfleet-api-spec) core repository.\n\n## Prerequisites\n\nAfter cloning the repository, install all dependencies:\n\n```bash\nnpm install\n```\n\nThis installs the TypeSpec compiler, all required libraries, and the `hyperfleet` shared package from GitHub into `node_modules/`.\n\n## Building OpenAPI Specification\n\n### Using npm Scripts (Recommended)\n\n```bash\n# Build OpenAPI 3.0\nnpm run build\n\n```\n\n### Using the Build Script Directly\n\n```bash\n./build-schema.sh            # OpenAPI 3.0 only\n```\n\nThe script compiles `main.tsp` and outputs `schemas/template/openapi.yaml` (and optionally `schemas/template/swagger.yaml`).\n\nThen run `npm install` and rebuild.\n\n### Testing HyperFleet API Schema validation\n\nWhen generating the `openapi.yaml` contract, the HyperFleet API requests can be validated against it.\nFollow documentation at [hyperfleet-api/docs/api-operator-guide](https://github.com/openshift-hyperfleet/hyperfleet-api/blob/main/docs/api-operator-guide.md#36-schema-validation)\n\n## Dependencies\n\n- `hyperfleet` — shared models and services from [hyperfleet-api-spec](https://github.com/openshift-hyperfleet/hyperfleet-api-spec)\n- `@typespec/compiler` — TypeSpec compiler\n- `@typespec/http` — HTTP protocol support\n- `@typespec/openapi` — OpenAPI decorators\n- `@typespec/openapi3` — OpenAPI 3.0 emitter\n- `api-spec-converter` — Converts OpenAPI 3.0 to OpenAPI 2.0 (Swagger)\n\n## Contributing\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, workflow, and PR guidelines.\n\n## Architecture Context\n\nThis repository is part of the HyperFleet project. For broader context:\n\n- Core API spec: \u003chttps://github.com/openshift-hyperfleet/hyperfleet-api-spec\u003e\n- Architecture repo: \u003chttps://github.com/openshift-hyperfleet/architecture\u003e\n- Main API implementation: \u003chttps://github.com/openshift-hyperfleet/hyperfleet-api\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenshift-hyperfleet%2Fhyperfleet-api-spec-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenshift-hyperfleet%2Fhyperfleet-api-spec-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenshift-hyperfleet%2Fhyperfleet-api-spec-template/lists"}