From d441c7b95d88ccafb991bdf85c50d571172fa107 Mon Sep 17 00:00:00 2001 From: mliptak0 Date: Tue, 11 Aug 2026 09:59:17 +0200 Subject: [PATCH 1/2] HYPERFLEET-1467 - feat: Add the read-only tenancy map to the Resource spec --- CHANGELOG.md | 9 ++++++++- main.tsp | 2 +- package-lock.json | 4 ++-- package.json | 2 +- schemas/core/openapi.yaml | 10 +++++++++- shared/models/resource/example_resource.tsp | 1 + shared/models/resource/model.tsp | 3 +++ 7 files changed, 25 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cbfa1e..26bcda8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.27] - 2026-08-11 + +### Added + +- `tenancy` map (string to string) to the `Resource` response model, server-populated and read-only (HYPERFLEET-1467) + ## [1.0.26] - 2026-07-09 ### Added @@ -240,7 +246,8 @@ First official stable release of the HyperFleet API specification. - Interactive API documentation -[Unreleased]: https://github.com/openshift-hyperfleet/hyperfleet-api-spec/compare/v1.0.26...HEAD +[Unreleased]: https://github.com/openshift-hyperfleet/hyperfleet-api-spec/compare/v1.0.27...HEAD +[1.0.27]: https://github.com/openshift-hyperfleet/hyperfleet-api-spec/compare/v1.0.26...v1.0.27 [1.0.26]: https://github.com/openshift-hyperfleet/hyperfleet-api-spec/compare/v1.0.25...v1.0.26 [1.0.25]: https://github.com/openshift-hyperfleet/hyperfleet-api-spec/compare/v1.0.24...v1.0.25 [1.0.23]: https://github.com/openshift-hyperfleet/hyperfleet-api-spec/compare/v1.0.22...v1.0.23 diff --git a/main.tsp b/main.tsp index 383961c..19d4184 100644 --- a/main.tsp +++ b/main.tsp @@ -30,7 +30,7 @@ using OpenAPI; */ @service(#{ title: "HyperFleet API" }) @info(#{ - version: "1.0.26", + version: "1.0.27", contact: #{ name: "HyperFleet Team", url: "https://github.com/openshift-hyperfleet", diff --git a/package-lock.json b/package-lock.json index 9e3c3f5..76e54aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "hyperfleet", - "version": "1.0.26", + "version": "1.0.27", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "hyperfleet", - "version": "1.0.26", + "version": "1.0.27", "devDependencies": { "@stoplight/spectral-cli": "6.15.1", "@typespec/compiler": "^1.6.0", diff --git a/package.json b/package.json index c8b33b7..d3b11d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hyperfleet", - "version": "1.0.26", + "version": "1.0.27", "type": "module", "exports": { "./*": "./*" diff --git a/schemas/core/openapi.yaml b/schemas/core/openapi.yaml index efc29ff..3a26907 100644 --- a/schemas/core/openapi.yaml +++ b/schemas/core/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: HyperFleet API - version: 1.0.26 + version: 1.0.27 contact: name: HyperFleet Team url: https://github.com/openshift-hyperfleet @@ -2446,6 +2446,11 @@ components: items: $ref: '#/components/schemas/ObjectReference' description: Non-ownership associations to other resources, keyed by reference type + tenancy: + type: object + additionalProperties: + type: string + description: Tenancy dimensions carried by the resource. Server-populated and read-only; not accepted on create or patch. created_time: type: string format: date-time @@ -2476,6 +2481,9 @@ components: environment: production team: platform spec: {} + tenancy: + organization_id: org-123 + account_id: acct-456 generation: 1 status: conditions: [] diff --git a/shared/models/resource/example_resource.tsp b/shared/models/resource/example_resource.tsp index cf59102..2bc5c1c 100644 --- a/shared/models/resource/example_resource.tsp +++ b/shared/models/resource/example_resource.tsp @@ -8,6 +8,7 @@ const exampleResource: Resource = #{ name: "my-resource-1", labels: #{ environment: "production", team: "platform" }, spec: #{}, + tenancy: #{ organization_id: "org-123", account_id: "acct-456" }, generation: 1, status: #{ conditions: #[], diff --git a/shared/models/resource/model.tsp b/shared/models/resource/model.tsp index 07576f9..16c0e00 100644 --- a/shared/models/resource/model.tsp +++ b/shared/models/resource/model.tsp @@ -49,6 +49,9 @@ model Resource { /** Non-ownership associations to other resources, keyed by reference type */ references?: Record; + /** Tenancy dimensions carried by the resource. Server-populated and read-only; not accepted on create or patch. */ + tenancy?: Record; + ...APIMetadata; } From 9284ae4babf345f4051de6c4d74669d8923cfb47 Mon Sep 17 00:00:00 2001 From: mliptak0 Date: Tue, 11 Aug 2026 10:33:02 +0200 Subject: [PATCH 2/2] HYPERFLEET-1467 - fix: mark tenancy field readOnly in generated schema Adds @visibility(Lifecycle.Read) to Resource.tenancy so the emitted OpenAPI schema explicitly flags it as readOnly, reinforcing that it is server-populated and not client-writable. Co-Authored-By: Claude Sonnet 5 --- schemas/core/openapi.yaml | 1 + shared/models/resource/model.tsp | 1 + 2 files changed, 2 insertions(+) diff --git a/schemas/core/openapi.yaml b/schemas/core/openapi.yaml index 3a26907..ff8fcb9 100644 --- a/schemas/core/openapi.yaml +++ b/schemas/core/openapi.yaml @@ -2451,6 +2451,7 @@ components: additionalProperties: type: string description: Tenancy dimensions carried by the resource. Server-populated and read-only; not accepted on create or patch. + readOnly: true created_time: type: string format: date-time diff --git a/shared/models/resource/model.tsp b/shared/models/resource/model.tsp index 16c0e00..373dd85 100644 --- a/shared/models/resource/model.tsp +++ b/shared/models/resource/model.tsp @@ -50,6 +50,7 @@ model Resource { references?: Record; /** Tenancy dimensions carried by the resource. Server-populated and read-only; not accepted on create or patch. */ + @visibility(Lifecycle.Read) tenancy?: Record; ...APIMetadata;