Skip to content

Conversation

@rafabene
Copy link
Contributor

@rafabene rafabene commented Jan 16, 2026

Summary

The hyperfleet-api repository was mistakenly updated first with changes to the RFC 9457 error model. This PR aligns hyperfleet-api-spec with those changes:

  • Remove separate ValidationConstraint enum, inlining values directly in the constraint field
  • Remove format: int32 from status field
  • Simplify ValidationError description

Test plan

  • Verify npm run build:core generates schema successfully
  • Compare generated schema with hyperfleet-api openapi.yaml

Summary by CodeRabbit

  • Refactor
    • Validation error constraint definitions now use inline string values and include an example for clarity
    • Error status field standardized as an integer across specs for consistency
    • Field-level validation error description shortened for simpler documentation and improved API spec clarity

✏️ Tip: You can customize this high-level summary in your review settings.

…perfleet-api

- Remove separate ValidationConstraint enum, inline values in constraint field
- Remove format: int32 from status field
- Simplify ValidationError description
@openshift-ci openshift-ci bot requested review from jsell-rh and mbrudnoy January 16, 2026 14:51
@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

Walkthrough

This PR removes the ValidationConstraint enum and inlines its allowed values into ValidationError.constraint as a string union/enum (values: "required", "min", "max", "min_length", "max_length", "pattern", "enum", "format", "unique") across TypeSpec and OpenAPI schema files. Error.status had its numeric format removed (changed from int32 to integer). Minor docstring/header wording adjustments were made around the ValidationError section.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

lgtm, approved

Suggested reviewers

  • rh-amarin
  • tirthct
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: refactoring the ValidationError model to align with hyperfleet-api by removing the ValidationConstraint enum and inlining its values.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.



📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0550a40 and c36e0ba.

📒 Files selected for processing (2)
  • schemas/gcp/openapi.yaml
  • schemas/gcp/swagger.yaml
🔇 Additional comments (5)
schemas/gcp/openapi.yaml (3)

1372-1384: LGTM! Inline enum values for constraint field.

The inlined enum values (required, min, max, min_length, max_length, pattern, enum, format, unique) with the example are well-defined and align with common validation constraint types.


1389-1389: LGTM! Simplified description.

The description "Field-level validation error detail" is concise. The RFC 9457 reference is appropriately retained in the parent Error schema description.


879-882: Verify: Error.status format removal is intentional.

The AI summary mentions that format: int32 was removed from Error.status. The current definition shows type: integer without a format. While this is valid per OpenAPI spec, removing int32 may affect code generation in some client SDKs (e.g., generating long instead of int). Confirm this aligns with the hyperfleet-api implementation.

schemas/gcp/swagger.yaml (2)

1511-1527: LGTM! Consistent with OpenAPI 3.0 schema.

The ValidationError definition is correctly aligned:

  • Simplified description
  • Inline enum with matching values (required, min, max, min_length, max_length, pattern, enum, format, unique)
  • Added example and explicit type: string

This is consistent with the changes in schemas/gcp/openapi.yaml.


1014-1017: Consistent: Error.status without format.

The status field is defined as type: integer without format: int32, matching the OpenAPI 3.0 schema and the PR objective.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@rh-amarin
Copy link
Collaborator

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Jan 16, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rh-amarin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 7bbc4ec into openshift-hyperfleet:main Jan 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants