Skip to content

feat(api): update spec#4610

Merged
tothandras merged 1 commit into
mainfrom
feat/update-spec
Jun 30, 2026
Merged

feat(api): update spec#4610
tothandras merged 1 commit into
mainfrom
feat/update-spec

Conversation

@tothandras

@tothandras tothandras commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Documentation

    • Updated the published API specification and service version metadata.
  • Bug Fixes

    • Standardized operation IDs for addon-related Metering and Billing endpoints to improve API consistency and tooling compatibility.

@tothandras tothandras requested a review from a team as a code owner June 30, 2026 11:06
@tothandras tothandras added the release-note/misc Miscellaneous changes label Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Makefile generate target gains a yq loop that renames seven addon operationId values to product-catalog-* in the MeteringAndBilling OpenAPI spec. The get-invoice operation gets three extension decorators (unstable, internal, private), and the Konnect service version is bumped from 0.0.1 to 1.0.0. The Go embedded swagger spec is regenerated to reflect all of these.

Changes

API Spec Updates and Regenerated Output

Layer / File(s) Summary
TypeSpec & Makefile spec changes
api/spec/Makefile, api/spec/packages/aip/src/invoices/operations.tsp, api/spec/packages/aip/src/konnect.tsp
Makefile adds a shell loop that renames *-addon operationIds to product-catalog-* via yq. get-invoice gets unstable/internal/private @extension decorators. Service version bumped to 1.0.0.
Regenerated Go swagger spec
api/v3/api.gen.go
Four contiguous chunks of the embedded base64-gzipped swaggerSpec array are replaced to match the updated operationIds, extension flags, and version string.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

release-note/feature

Suggested reviewers

  • rolosp
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the API spec changes, but it's too vague to convey the main update clearly. Use a more specific title that names the main spec change, such as the Metering and Billing/OpenAPI operationId and spec version updates.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/update-spec

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@tothandras tothandras enabled auto-merge (squash) June 30, 2026 11:07
@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the v3 API spec generation and generated artifacts. The main changes are:

  • Adds addon operationId post-processing to the API spec Makefile.
  • Marks invoice retrieval as private, internal, and unstable.
  • Bumps the Konnect TypeSpec service version to 1.0.0.
  • Regenerates the v3 OpenAPI and Go embedded spec.

Confidence Score: 4/5

The API generation path needs a fix before merging.

  • The addon operationId rewrite edits openapi.MeteringAndBilling.yaml.
  • The committed v3 OpenAPI file is generated from openapi.OpenMeter.yaml.
  • The expected renamed addon operation IDs do not reach the artifact used by downstream generated code.

api/spec/Makefile

Important Files Changed

Filename Overview
api/spec/Makefile Adds addon operationId rewriting, but targets a generated file that is not used for the committed v3 OpenAPI bundle.
api/spec/packages/aip/src/invoices/operations.tsp Adds private, internal, and unstable OpenAPI extensions to invoice retrieval.
api/spec/packages/aip/src/konnect.tsp Updates the Konnect service OpenAPI version from 0.0.1 to 1.0.0.
api/v3/openapi.yaml Regenerated v3 OpenAPI output includes invoice visibility extensions but still has the old addon operationIds.
api/v3/api.gen.go Regenerated Go embedded OpenAPI spec to match the updated v3 API definition.

Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
api/spec/Makefile:18
**Rewrite Targets Wrong Spec**

The loop rewrites `openapi.MeteringAndBilling.yaml`, but the committed v3 spec is bundled from `openapi.OpenMeter.yaml` on the next command. A normal `generate` run therefore leaves the addon operation IDs in `api/v3/openapi.yaml` as `list-addons`, `create-addon`, and the other old names, so generated clients and handlers keep the unprefixed contract instead of the intended product-catalog-prefixed one.

Reviews (1): Last reviewed commit: "feat(api): update spec" | Re-trigger Greptile

Comment thread api/spec/Makefile
done
# Prefix addon operationIds with `product-catalog-` for the v3 MeteringAndBilling output
@FILE="packages/aip/output/definitions/metering-and-billing/v3/openapi.MeteringAndBilling.yaml"; \
for op in list-addons create-addon update-addon get-addon delete-addon archive-addon publish-addon; do \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Rewrite Targets Wrong Spec

The loop rewrites openapi.MeteringAndBilling.yaml, but the committed v3 spec is bundled from openapi.OpenMeter.yaml on the next command. A normal generate run therefore leaves the addon operation IDs in api/v3/openapi.yaml as list-addons, create-addon, and the other old names, so generated clients and handlers keep the unprefixed contract instead of the intended product-catalog-prefixed one.

Prompt To Fix With AI
This is a comment left during a code review.
Path: api/spec/Makefile
Line: 18

Comment:
**Rewrite Targets Wrong Spec**

The loop rewrites `openapi.MeteringAndBilling.yaml`, but the committed v3 spec is bundled from `openapi.OpenMeter.yaml` on the next command. A normal `generate` run therefore leaves the addon operation IDs in `api/v3/openapi.yaml` as `list-addons`, `create-addon`, and the other old names, so generated clients and handlers keep the unprefixed contract instead of the intended product-catalog-prefixed one.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code Fix in Codex

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
api/spec/Makefile (1)

16-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding a post-rename verification step.

The yq rename loop silently continues if an operationId doesn't exist. If someone removes an addon endpoint from the TypeSpec but forgets to update this Makefile loop, the build won't fail — it'll just leave stale entries here. A quick verification that all *-addon operationIds were actually consumed (or that none remain in the output) would turn that into a build failure instead of a silent drift.

🤖 Prompt for 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.

In `@api/spec/Makefile` around lines 16 - 21, The addon operationId rename loop in
the Makefile can silently miss entries if a requested `operationId` is absent,
so add a verification step after the `yq` renames to confirm all expected addon
IDs were updated or that no `*-addon` operationIds remain in the generated
MeteringAndBilling v3 OpenAPI output. Use the existing loop around the `yq`
invocation and the `FILE`/`op` variables to perform the check, and make the
target fail the build if any expected rename did not occur.
api/spec/packages/aip/src/invoices/operations.tsp (1)

27-36: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Clarify the docstring to match the heavy restriction markings.

The get-invoice operation is now marked x-unstable, x-internal, and x-private — that's a lot of caution tape! The docstring still reads like a normal public API description. Consider adding a note about who can actually use this endpoint (internal systems only? not customer-facing? subject to change without notice?).

Also, x-internal + x-private together might be redundant depending on how your tooling interprets them — x-private ("not exposed to customers") usually implies x-internal. Worth double-checking if both are needed or if one suffices for your generators.

🤖 Prompt for 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.

In `@api/spec/packages/aip/src/invoices/operations.tsp` around lines 27 - 36, The
get-invoice operation’s summary/docstring is too generic for its current access
restrictions. Update the metadata on the get method in Invoices operations to
clearly state that this endpoint is internal-only, not customer-facing, and
subject to change, and review whether both Shared.InternalExtension and
Shared.PrivateExtension are needed or if one is redundant for your generators.
Keep the operationId and response shape unchanged, and make the description
match the x-unstable/x-internal/x-private markings.
🤖 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.

Nitpick comments:
In `@api/spec/Makefile`:
- Around line 16-21: The addon operationId rename loop in the Makefile can
silently miss entries if a requested `operationId` is absent, so add a
verification step after the `yq` renames to confirm all expected addon IDs were
updated or that no `*-addon` operationIds remain in the generated
MeteringAndBilling v3 OpenAPI output. Use the existing loop around the `yq`
invocation and the `FILE`/`op` variables to perform the check, and make the
target fail the build if any expected rename did not occur.

In `@api/spec/packages/aip/src/invoices/operations.tsp`:
- Around line 27-36: The get-invoice operation’s summary/docstring is too
generic for its current access restrictions. Update the metadata on the get
method in Invoices operations to clearly state that this endpoint is
internal-only, not customer-facing, and subject to change, and review whether
both Shared.InternalExtension and Shared.PrivateExtension are needed or if one
is redundant for your generators. Keep the operationId and response shape
unchanged, and make the description match the x-unstable/x-internal/x-private
markings.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 194e7621-e5d3-4756-a407-8b2cb1404166

📥 Commits

Reviewing files that changed from the base of the PR and between d04b21d and 407315b.

⛔ Files ignored due to path filters (1)
  • api/v3/openapi.yaml is excluded by !**/openapi.yaml
📒 Files selected for processing (4)
  • api/spec/Makefile
  • api/spec/packages/aip/src/invoices/operations.tsp
  • api/spec/packages/aip/src/konnect.tsp
  • api/v3/api.gen.go

@tothandras tothandras merged commit 79c88f3 into main Jun 30, 2026
29 of 31 checks passed
@tothandras tothandras deleted the feat/update-spec branch June 30, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/misc Miscellaneous changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants