HYPERFLEET-1143 - chore: Remove kind from list schemas#6
Conversation
📝 WalkthroughWalkthroughThe API spec version advances from Estimated code review effort🎯 3 (Moderate) | ⏱️ ~28 minutes The schema hierarchy is compact; the bulk is repetitive error mapping across two parallel specs. CWE-20 (Improper Input Validation): verify all 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@schemas/template/openapi.yaml`:
- Around line 1969-1989: The Spectral lint flags ForbiddenDetails and
ForbiddenResponse as unused; update the upstream TypeSpec definitions so these
schemas are actually referenced by 403 responses or remove them from the core
models and regenerate the OpenAPI: either wire
ForbiddenDetails/ForbiddenResponse into the appropriate service operation
responses in the .tsp files (attach ForbiddenResponse as the 403 response for
relevant operations) or delete the corresponding model declarations in the
TypeSpec sources and run the generator to produce a spec without these unused
components, then re-run CI.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 263b9b9e-cbea-4bd4-bb59-4c6a8a782968
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
CHANGELOG.mdmain.tspschemas/template/openapi.yamlschemas/template/swagger.yaml
|
|
||
| ### Removed | ||
|
|
||
| - `kind` property from `ClusterList`, `NodePoolList`, `AdapterStatusList`, and `ResourceList` list response schemas — inherited from core spec update (HYPERFLEET-1143) |
There was a problem hiding this comment.
Warning
Blocking
Category: Bug
This entry lists AdapterStatusList and ResourceList, but neither schema exists in the template spec — they belong to the core hyperfleet-api. The actual list schemas that had kind removed in the generated YAML are ChannelList, ClusterList, NodePoolList, and WIFConfigList.
| - `kind` property from `ClusterList`, `NodePoolList`, `AdapterStatusList`, and `ResourceList` list response schemas — inherited from core spec update (HYPERFLEET-1143) | |
| - `kind` property from `ChannelList`, `ClusterList`, `NodePoolList`, and `WIFConfigList` list response schemas — inherited from core spec update (HYPERFLEET-1143) |
|
|
||
| ## [Unreleased] | ||
|
|
||
| ## [1.0.22] - 2026-06-04 |
There was a problem hiding this comment.
Tip
nit — non-blocking suggestion
Category: Pattern
This release also picks up the error model rewrite from core spec v1.0.20 (HYPERFLEET-993), which is a breaking change for consumers doing code generation: Error → ProblemDetails, new status-specific schemas (BadRequestDetails, ConflictDetails, etc.), and minimum: 1 on pagination params. Consider documenting these under a ### Changed subsection so upgraders know what to expect. For example:
### Changed
- Error responses now use RFC 9457 `ProblemDetails` format with status-specific schemas (`BadRequestDetails`, `ConflictDetails`, `NotFoundDetails`, `UnauthorizedDetails`) — inherited from core spec update (HYPERFLEET-993)
- Pagination query parameters (`page`, `pageSize`) now enforce `minimum: 1`|
|
||
| ## [Unreleased] | ||
|
|
||
| ## [1.0.23] - 2026-06-11 |
There was a problem hiding this comment.
Tip
nit — non-blocking suggestion
Category: Standards
This release removes kind from list schema required fields and rewrites the error model (Error → ProblemDetails), both breaking changes for consumers doing code generation. Per the commit standard, the squash merge commit should include a BREAKING CHANGE: footer. Consider adding this to the PR body so it lands in the squash commit:
BREAKING CHANGE: `kind` removed from required fields in ChannelList, ClusterList,
NodePoolList, VersionList, WifConfigList. Error schema renamed from `Error` to
`ProblemDetails` with status-specific schemas (BadRequestDetails, ConflictDetails,
NotFoundDetails, UnauthorizedDetails). Consumers must regenerate clients from
the updated spec.
There was a problem hiding this comment.
Added a footer in the PR body
| required: | ||
| - type | ||
| - title | ||
| - status |
There was a problem hiding this comment.
Tip
nit — non-blocking suggestion
Category: Standards
The HyperFleet error model standard marks detail as Required=Yes, but this generated schema only requires type, title, status. The fix is upstream in the core spec's TypeSpec definitions — either add detail to the required list in the TypeSpec model, or update the standard to match RFC 9457's treatment of detail as optional.
# Current
required:
- type
- title
- status
# Expected per HyperFleet standard
required:
- type
- title
- status
- detailThere was a problem hiding this comment.
Created https://redhat.atlassian.net/browse/HYPERFLEET-1231 to track this change in the TypeSpec definition
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rafabene The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
421b446
into
openshift-hyperfleet:main
Summary
mainand regenerate schemaskindproperty removed from all list response schemas (ChannelList,ClusterList,NodePoolList,VersionList,WifConfigList) — inherited from core spec HYPERFLEET-1143ProblemDetailsformat — inherited from core spec HYPERFLEET-993Context
The template's npm dependency on the core spec (
hyperfleet-api-spec#main) was stale — pinned to commit 78199f6 (HYPERFLEET-1103 repo split). This refresh picks up 4 core releases:core/andshared/directorieskindremoved from list response schemasChanges
main.tsp— version bump to 1.0.23CHANGELOG.md— added 1.0.23 entry (Removed + Changed).spectral.yaml— addedForbiddenResponseunused component overridepackage-lock.json— refreshed core spec dependencyschemas/template/openapi.yaml— regeneratedschemas/template/swagger.yaml— regeneratedTest plan
spectral lintpasseskindabsent from all list schemaskindstill present on individual resource schemasBREAKING CHANGE:
kindremoved from required fields in ChannelList, ClusterList,NodePoolList, VersionList, WifConfigList. Error schema renamed from
ErrortoProblemDetailswith status-specific schemas (BadRequestDetails, ConflictDetails,NotFoundDetails, UnauthorizedDetails). Consumers must regenerate clients from
the updated spec.