Skip to content

feat(core): allow operationName override to decouple type names from method names - #3693

Merged
melloware merged 1 commit into
orval-labs:masterfrom
aqeelat:feat/3684-operationname-tuple-type-decoupling
Jul 12, 2026
Merged

feat(core): allow operationName override to decouple type names from method names#3693
melloware merged 1 commit into
orval-labs:masterfrom
aqeelat:feat/3684-operationname-tuple-type-decoupling

Conversation

@aqeelat

@aqeelat aqeelat commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Problem

When override.operationName strips path segments to produce clean method names, all operation-specific type identifiers (*Params, *Body, *Error, *Result) derive from the stripped name. With tags-split + splitByTags + indexFiles, operations in different tags that share the same stripped name produce colliding type names, causing TS2300 at the barrel level.

Closes #3684.

Solution

Extend the operationName callback return type from string to string | [string, string]. Returning [methodName, typeNameBase] decouples function/hook names from type-identifier names. Fully backward compatible — existing callbacks returning string work unchanged.

override: {
  operationName: (_op, route, verb) => {
    const segments = route.split('/').filter(Boolean);
    return [
      `${verb}${pascal(segments.slice(2).join('-'))}`,  // getProducts
      `${verb}${pascal(segments.slice(1).join('-'))}`,  // getCatalogProducts
    ];
  },
}

Changes

  • GeneratorVerbOptions gains a typeName field (defaults to operationName when no tuple is returned)
  • All type-identifier derivations (*Params, *Body, *Error, *Result, *Accept, zod/hono/effect schema names) use typeName
  • All function/hook name derivations keep operationName
  • Updated across 10 client packages: axios, swr, query, angular, zod, hono, effect, fetch, mcp, + write-zod-specs
  • Core getters (getResponse, getBody, getQueryParams, getProps) receive typeName as the name base
  • generateMutator receives typeName so errorTypeName/bodyTypeName match

Tests

  • 4 integration tests: axios tuple decoupling, backward compat, tags-split uniqueness, swr hook/error decoupling
  • E2E snapshot test with gateway-style spec + tags-split + splitByTags + indexFiles
  • 3331 tests pass, 0 new failures (4 pre-existing failures unrelated to this change)

Notes

Summary by CodeRabbit

  • New Features
    • override.operationName can now return string or [methodName, typeName] to independently control generated endpoint/hook names vs result/schema/type identifiers, including tag-split outputs.
  • Bug Fixes
    • Improved naming consistency across response/error types, validators/schemas, and multi-content/variant generations across supported clients.
  • Documentation
    • Updated configuration reference to explain the tuple form and how each element affects generated names.
  • Tests
    • Added tuple-focused test coverage, fixtures, and a new Gateway Tuple demo spec/config.

Copilot AI review requested due to automatic review settings July 8, 2026 21:39

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds tuple-return support for override.operationName, introduces typeName in verb options, and updates generated type and schema identifiers across clients and generators. Documentation, configuration, fixtures, and integration tests cover decoupled method and type naming.

Changes

Type-name decoupling feature

Layer / File(s) Summary
Core contract and verb options
packages/core/src/types.ts, packages/core/src/generators/verbs-options.ts, docs/content/docs/reference/configuration/output.mdx, tests/configs/axios.config.ts, tests/specifications/gateway-tuple.yaml
operationName overrides accept strings or tuples, verb generation stores separate method and type names, and the naming contract is documented and configured.
HTTP client, schema, and handler generators
packages/angular/src/*, packages/axios/src/index.ts, packages/fetch/src/index.ts, packages/effect/src/index.ts, packages/zod/src/index.ts, packages/hono/src/index.ts, packages/mcp/src/index.ts, packages/orval/src/write-zod-specs.ts
Generated result, response, accept, validator, context, tool, and schema identifiers derive from typeName.
Query and SWR generators
packages/query/src/*, packages/swr/src/*
Query, mutation, and SWR generators propagate typeName through variants and use it for emitted result and error aliases.
Fixtures and regression coverage
packages/angular/src/*.test.ts, packages/hono/src/index.test.ts, packages/mock/src/msw/index.test.ts, packages/orval/src/*test.ts, packages/zod/src/zod.test.ts
Fixtures provide the required typeName, while tests cover tuple naming, legacy strings, tag splitting, deduplication, and SWR error types.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: melloware

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main change: decoupling method names from type-name bases via operationName override.
Linked Issues check ✅ Passed The changes implement tuple-based operationName overrides and propagate typeName to generated type identifiers across the affected generators.
Out of Scope Changes check ✅ Passed The added docs, fixtures, and tests all support the tuple naming change and do not introduce unrelated scope.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/hono/src/index.test.ts (1)

10-16: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

verb helper is missing the required typeName field.

The verb helper creates GeneratorVerbOptions without typeName. Since the Hono generator now calls pascal(verbOption.typeName), verbs from this helper would yield pascal(undefined) = '', producing unprefixed context type names (e.g., export type Context<...> instead of ListPetsContext<...>). This shadows the imported Context from hono and would break any test that checks for specific type names. The formVerb fixture was correctly updated with typeName, but this helper was missed.

🛡️ Proposed fix
 const verb = (operationName: string): GeneratorVerbOptions =>
   ({
     operationName,
+    typeName: operationName,
     params: [],
     body: { definition: '' },
     response: { originalSchema: {} },
   }) as unknown as GeneratorVerbOptions;
🤖 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 `@packages/hono/src/index.test.ts` around lines 10 - 16, The verb helper is
constructing GeneratorVerbOptions without the required typeName, so update the
verb fixture to include a meaningful typeName alongside operationName in the
test helper. Use the existing verb() helper in the Hono tests as the single
place to fix this so calls to pascal(verbOption.typeName) produce the expected
prefixed context type names and do not shadow the imported Context symbol.
Ensure the helper matches the formVerb fixture’s shape by always returning a
complete GeneratorVerbOptions object.
🧹 Nitpick comments (3)
packages/angular/src/http-client.ts (1)

135-136: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Parameter names in getAcceptHelperName and buildAcceptHelper are now misleading.

Both functions declare their first parameter as operationName, but they are now called with typeName values (lines 203 and 478). Consider renaming to a neutral name like nameBase or typeNameBase to reflect the actual semantic.

♻️ Optional parameter rename
-export const getAcceptHelperName = (operationName: string) =>
-  `${pascal(operationName)}Accept`;
+export const getAcceptHelperName = (nameBase: string) =>
+  `${pascal(nameBase)}Accept`;
 const buildAcceptHelper = (
-  operationName: string,
+  nameBase: string,
   contentTypes: string[],
   output: ContextSpec['output'],
 ): string => {
-  const acceptHelperName = getAcceptHelperName(operationName);
+  const acceptHelperName = getAcceptHelperName(nameBase);

Also applies to: 157-158, 203-203, 478-478

🤖 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 `@packages/angular/src/http-client.ts` around lines 135 - 136, The first
parameter names in getAcceptHelperName and buildAcceptHelper no longer match how
they are used, since they now receive typeName values instead of operation
names. Rename the parameter to a neutral identifier such as nameBase or
typeNameBase in both functions, and update the call sites in http-client.ts that
pass this value so the naming stays consistent and accurate.
packages/fetch/src/index.ts (1)

679-687: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Rename stale operationName parameter to typeName.

fetchResponseTypeName's third parameter is still named operationName, but every call site (line 329) now passes typeName. Functionally fine (positional), but misleading for readers.

✏️ Suggested rename
 export const fetchResponseTypeName = (
   includeHttpResponseReturnType: boolean | undefined,
   definitionSuccessResponse: string,
-  operationName: string,
+  typeName: string,
 ) => {
   return includeHttpResponseReturnType
-    ? `${operationName}Response`
+    ? `${typeName}Response`
     : definitionSuccessResponse;
 };
🤖 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 `@packages/fetch/src/index.ts` around lines 679 - 687, Rename the stale third
parameter of fetchResponseTypeName from operationName to typeName so the
signature matches its callers and current usage. Update the function definition
and any local references inside fetchResponseTypeName to use typeName, keeping
the behavior unchanged. This should align the symbol with the call site that
already passes typeName and avoid misleading readers.
packages/orval/src/generate-spec.test.ts (1)

1264-1469: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Test coverage is solid; minor duplication and coverage gap.

The test suite comprehensively covers tuple decoupling, backward compatibility, tags-split uniqueness, and SWR error type naming. Two minor observations:

  1. The cap helper is duplicated across four test cases (lines 1317, 1390, 1443) and in tests/configs/axios.config.ts. Consider extracting it to a shared helper.

  2. The tags-split test (lines 1414-1422) verifies type names don't bleed across tag files but doesn't assert method name isolation (e.g., catalogContent.not.toContain('getProducts')). Adding those assertions would strengthen the "scoped per tag" claim.

🤖 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 `@packages/orval/src/generate-spec.test.ts` around lines 1264 - 1469, The new
tuple-name tests in generateSpec are good, but there is duplicated
capitalization logic and a small tags-split coverage gap. Extract the repeated
cap helper used in the operationName callbacks into a shared test helper
(reusing the same symbol pattern across these cases and the config test), and
strengthen the tags-split assertion in the tags-split test by also checking that
each tag file does not contain the other tag’s method name, alongside the
existing type-name isolation checks.
🤖 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.

Outside diff comments:
In `@packages/hono/src/index.test.ts`:
- Around line 10-16: The verb helper is constructing GeneratorVerbOptions
without the required typeName, so update the verb fixture to include a
meaningful typeName alongside operationName in the test helper. Use the existing
verb() helper in the Hono tests as the single place to fix this so calls to
pascal(verbOption.typeName) produce the expected prefixed context type names and
do not shadow the imported Context symbol. Ensure the helper matches the
formVerb fixture’s shape by always returning a complete GeneratorVerbOptions
object.

---

Nitpick comments:
In `@packages/angular/src/http-client.ts`:
- Around line 135-136: The first parameter names in getAcceptHelperName and
buildAcceptHelper no longer match how they are used, since they now receive
typeName values instead of operation names. Rename the parameter to a neutral
identifier such as nameBase or typeNameBase in both functions, and update the
call sites in http-client.ts that pass this value so the naming stays consistent
and accurate.

In `@packages/fetch/src/index.ts`:
- Around line 679-687: Rename the stale third parameter of fetchResponseTypeName
from operationName to typeName so the signature matches its callers and current
usage. Update the function definition and any local references inside
fetchResponseTypeName to use typeName, keeping the behavior unchanged. This
should align the symbol with the call site that already passes typeName and
avoid misleading readers.

In `@packages/orval/src/generate-spec.test.ts`:
- Around line 1264-1469: The new tuple-name tests in generateSpec are good, but
there is duplicated capitalization logic and a small tags-split coverage gap.
Extract the repeated cap helper used in the operationName callbacks into a
shared test helper (reusing the same symbol pattern across these cases and the
config test), and strengthen the tags-split assertion in the tags-split test by
also checking that each tag file does not contain the other tag’s method name,
alongside the existing type-name isolation checks.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cf14d32f-e296-4ccd-b0e6-51de24fc142c

📥 Commits

Reviewing files that changed from the base of the PR and between 8d9d8b3 and 39c65a8.

⛔ Files ignored due to path filters (9)
  • tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.ts is excluded by !**/__snapshots__/**
📒 Files selected for processing (25)
  • docs/content/docs/reference/configuration/output.mdx
  • packages/angular/src/http-client.test.ts
  • packages/angular/src/http-client.ts
  • packages/angular/src/http-resource.test.ts
  • packages/angular/src/http-resource.ts
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/core/src/types.ts
  • packages/effect/src/index.ts
  • packages/fetch/src/index.ts
  • packages/hono/src/index.test.ts
  • packages/hono/src/index.ts
  • packages/mcp/src/index.ts
  • packages/mock/src/msw/index.test.ts
  • packages/orval/src/generate-spec.test.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/query/src/mutation-generator.ts
  • packages/query/src/query-generator.ts
  • packages/swr/src/index.ts
  • packages/zod/src/index.ts
  • packages/zod/src/zod.test.ts
  • tests/configs/axios.config.ts
  • tests/specifications/gateway-tuple.yaml

@pkg-pr-new

pkg-pr-new Bot commented Jul 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

@orval/angular

bun add https://pkg.pr.new/@orval/angular@625641b

@orval/axios

bun add https://pkg.pr.new/@orval/axios@625641b

@orval/core

bun add https://pkg.pr.new/@orval/core@625641b

@orval/effect

bun add https://pkg.pr.new/@orval/effect@625641b

@orval/fetch

bun add https://pkg.pr.new/@orval/fetch@625641b

@orval/hono

bun add https://pkg.pr.new/@orval/hono@625641b

@orval/mcp

bun add https://pkg.pr.new/@orval/mcp@625641b

@orval/mock

bun add https://pkg.pr.new/@orval/mock@625641b

orval

bun add https://pkg.pr.new/orval@625641b

@orval/query

bun add https://pkg.pr.new/@orval/query@625641b

@orval/solid-start

bun add https://pkg.pr.new/@orval/solid-start@625641b

@orval/swr

bun add https://pkg.pr.new/@orval/swr@625641b

@orval/zod

bun add https://pkg.pr.new/@orval/zod@625641b

commit: 625641b

@aqeelat
aqeelat force-pushed the feat/3684-operationname-tuple-type-decoupling branch from 39c65a8 to 0a09968 Compare July 9, 2026 01:13

@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.

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 `@packages/fetch/src/index.ts`:
- Around line 679-687: The SWR mutation fetcher type helper is still using
operationName in the GET + FETCH path, which causes the generated response alias
to use the wrong base name. Update the call in getSwrMutationFetcherType so it
passes typeName through to fetchResponseTypeName instead of operationName, and
keep the surrounding SWR fetcher type generation aligned with the new
type-name-based response alias.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a05d43b1-6e91-4917-b1d1-c3fd3c5ba848

📥 Commits

Reviewing files that changed from the base of the PR and between 39c65a8 and 0a09968.

⛔ Files ignored due to path filters (9)
  • tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.ts is excluded by !**/__snapshots__/**
📒 Files selected for processing (25)
  • docs/content/docs/reference/configuration/output.mdx
  • packages/angular/src/http-client.test.ts
  • packages/angular/src/http-client.ts
  • packages/angular/src/http-resource.test.ts
  • packages/angular/src/http-resource.ts
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/core/src/types.ts
  • packages/effect/src/index.ts
  • packages/fetch/src/index.ts
  • packages/hono/src/index.test.ts
  • packages/hono/src/index.ts
  • packages/mcp/src/index.ts
  • packages/mock/src/msw/index.test.ts
  • packages/orval/src/generate-spec.test.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/query/src/mutation-generator.ts
  • packages/query/src/query-generator.ts
  • packages/swr/src/index.ts
  • packages/zod/src/index.ts
  • packages/zod/src/zod.test.ts
  • tests/configs/axios.config.ts
  • tests/specifications/gateway-tuple.yaml
✅ Files skipped from review due to trivial changes (1)
  • packages/angular/src/http-resource.test.ts
🚧 Files skipped from review as they are similar to previous changes (21)
  • packages/hono/src/index.test.ts
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • packages/core/src/types.ts
  • tests/configs/axios.config.ts
  • packages/mcp/src/index.ts
  • packages/zod/src/index.ts
  • packages/orval/src/write-zod-specs.test.ts
  • docs/content/docs/reference/configuration/output.mdx
  • packages/query/src/mutation-generator.ts
  • packages/mock/src/msw/index.test.ts
  • packages/angular/src/http-client.ts
  • packages/angular/src/http-client.test.ts
  • packages/hono/src/index.ts
  • packages/swr/src/index.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/effect/src/index.ts
  • packages/angular/src/http-resource.ts
  • packages/zod/src/zod.test.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/query/src/query-generator.ts

Comment thread packages/fetch/src/index.ts
@aqeelat
aqeelat force-pushed the feat/3684-operationname-tuple-type-decoupling branch from 0a09968 to 173143a Compare July 9, 2026 09:28

@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 (1)
packages/orval/src/generate-spec.test.ts (1)

1264-1471: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Tests are well-structured and cover the key scenarios.

The four test cases comprehensively validate tuple decoupling, backward compatibility, tags-split uniqueness, and SWR-specific naming. The GATEWAY_SPEC fixture is minimal but sufficient. The try/finally cleanup pattern is correct.

One minor observation: the cap helper is duplicated across three test cases (lines 1317-1318, 1390-1391, 1445-1446). Consider extracting it to a shared local within the describe block.

♻️ Optional: extract shared `cap` helper
 describe('generateSpec - operationName tuple [methodName, typeName]', () => {
+  const cap = (s: string) => s.charAt(0).toUpperCase() + s.slice(1);
+
   const GATEWAY_SPEC: OpenApiDocument = {
     // ...
   };
 
   it('decouples method names from type names when operationName returns a tuple', async () => {
     // ...
     const options = await normalizeOptions(
       {
         // ...
         override: {
           operationName: (_operation, route, verb) => {
             const segments = route.split('/').filter(Boolean);
-            const cap = (s: string) =>
-              s.charAt(0).toUpperCase() + s.slice(1);
             return [
               `${verb}${segments.slice(2).map(cap).join('')}`,
               `${verb}${segments.slice(1).map(cap).join('')}`,
             ];
           },
         },
       },
       // ...
     );
   });
🤖 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 `@packages/orval/src/generate-spec.test.ts` around lines 1264 - 1471, The `cap`
helper is duplicated across multiple tests in `generateSpec - operationName
tuple [methodName, typeName]`; extract it once into a shared local helper inside
the surrounding `describe` block and reuse it in the `operationName` callbacks
for the tuple, tags-split, and SWR cases. Keep the test behavior unchanged, just
remove the repeated inline definitions.
🤖 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 `@packages/orval/src/generate-spec.test.ts`:
- Around line 1264-1471: The `cap` helper is duplicated across multiple tests in
`generateSpec - operationName tuple [methodName, typeName]`; extract it once
into a shared local helper inside the surrounding `describe` block and reuse it
in the `operationName` callbacks for the tuple, tags-split, and SWR cases. Keep
the test behavior unchanged, just remove the repeated inline definitions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: eb4d8047-d20b-448e-9b24-1e1b93a760d1

📥 Commits

Reviewing files that changed from the base of the PR and between 0a09968 and 173143a.

⛔ Files ignored due to path filters (9)
  • tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.ts is excluded by !**/__snapshots__/**
📒 Files selected for processing (26)
  • docs/content/docs/reference/configuration/output.mdx
  • packages/angular/src/http-client.test.ts
  • packages/angular/src/http-client.ts
  • packages/angular/src/http-resource.test.ts
  • packages/angular/src/http-resource.ts
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/core/src/types.ts
  • packages/effect/src/index.ts
  • packages/fetch/src/index.ts
  • packages/hono/src/index.test.ts
  • packages/hono/src/index.ts
  • packages/mcp/src/index.ts
  • packages/mock/src/msw/index.test.ts
  • packages/orval/src/generate-spec.test.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/query/src/mutation-generator.ts
  • packages/query/src/query-generator.ts
  • packages/swr/src/client.ts
  • packages/swr/src/index.ts
  • packages/zod/src/index.ts
  • packages/zod/src/zod.test.ts
  • tests/configs/axios.config.ts
  • tests/specifications/gateway-tuple.yaml
✅ Files skipped from review due to trivial changes (1)
  • packages/hono/src/index.test.ts
🚧 Files skipped from review as they are similar to previous changes (22)
  • packages/angular/src/utils.test.ts
  • packages/mock/src/msw/index.test.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/angular/src/http-resource.ts
  • docs/content/docs/reference/configuration/output.mdx
  • packages/query/src/query-generator.ts
  • packages/effect/src/index.ts
  • packages/zod/src/index.ts
  • tests/configs/axios.config.ts
  • packages/mcp/src/index.ts
  • packages/axios/src/index.ts
  • packages/hono/src/index.ts
  • packages/core/src/types.ts
  • packages/angular/src/http-client.ts
  • packages/query/src/mutation-generator.ts
  • packages/swr/src/index.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/fetch/src/index.ts
  • packages/zod/src/zod.test.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/angular/src/http-resource.test.ts
  • packages/angular/src/http-client.test.ts

@aqeelat
aqeelat force-pushed the feat/3684-operationname-tuple-type-decoupling branch from 173143a to f12241c Compare July 9, 2026 16:33

@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)
packages/orval/src/generate-spec.test.ts (2)

1428-1467: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider asserting the inventory hook name in the SWR test.

The test verifies useGetItems for the catalog endpoint and both error type names, but doesn't assert the inventory SWR hook name useGetProducts. Adding this assertion would make the decoupling verification symmetric.

✨ Suggested addition
     // Hook name uses bare method name
     expect(content).toContain('useGetItems');
+    expect(content).toContain('useGetProducts');
     // Error type uses service-prefixed type name
     expect(content).toContain('GetCatalogItemsQueryError');
     expect(content).toContain('GetInventoryProductsQueryError');
🤖 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 `@packages/orval/src/generate-spec.test.ts` around lines 1428 - 1467, The SWR
decoupling test is missing an assertion for the inventory hook name, so it only
checks the catalog hook and error types. Update the generate-spec test case in
the `it('decouples swr hook names from error type names'...)` block to also
assert the inventory hook name produced by `generateSpec`, alongside the
existing `useGetItems` and error type checks. Use the existing `content`
expectations in this test to verify `useGetProducts` as well, so the hook-name
decoupling coverage is symmetric.

1344-1373: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider strengthening the backward-compatibility test.

The operationName override returns ${verb}Products for both operations, so both the catalog and inventory endpoints receive the same name getProducts. The test only asserts toContain('getProducts') and toContain('GetProductsResult'), which doesn't verify that both operations are handled distinctly. A more robust backward-compat test would return distinct strings per route (mirroring real-world usage) and assert both generated functions/types appear.

🤖 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 `@packages/orval/src/generate-spec.test.ts` around lines 1344 - 1373, The
backward-compatibility test in generate-spec.test should verify distinct
operation names rather than the same `${verb}Products` for every route. Update
the `operationName` override in the `backward compatible when operationName
returns a string` test to return different strings based on the route or
operation, then assert that both generated endpoint functions and their
corresponding result types are present in the output. Use the existing
`generateSpec` and `normalizeOptions` flow as-is, but strengthen the assertions
so the test proves multiple operations are handled independently.
🤖 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 `@packages/orval/src/generate-spec.test.ts`:
- Around line 1428-1467: The SWR decoupling test is missing an assertion for the
inventory hook name, so it only checks the catalog hook and error types. Update
the generate-spec test case in the `it('decouples swr hook names from error type
names'...)` block to also assert the inventory hook name produced by
`generateSpec`, alongside the existing `useGetItems` and error type checks. Use
the existing `content` expectations in this test to verify `useGetProducts` as
well, so the hook-name decoupling coverage is symmetric.
- Around line 1344-1373: The backward-compatibility test in generate-spec.test
should verify distinct operation names rather than the same `${verb}Products`
for every route. Update the `operationName` override in the `backward compatible
when operationName returns a string` test to return different strings based on
the route or operation, then assert that both generated endpoint functions and
their corresponding result types are present in the output. Use the existing
`generateSpec` and `normalizeOptions` flow as-is, but strengthen the assertions
so the test proves multiple operations are handled independently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 46ab9298-5721-4246-b378-3667c7a1d4ea

📥 Commits

Reviewing files that changed from the base of the PR and between 173143a and f12241c.

⛔ Files ignored due to path filters (9)
  • tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.ts is excluded by !**/__snapshots__/**
📒 Files selected for processing (26)
  • docs/content/docs/reference/configuration/output.mdx
  • packages/angular/src/http-client.test.ts
  • packages/angular/src/http-client.ts
  • packages/angular/src/http-resource.test.ts
  • packages/angular/src/http-resource.ts
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/core/src/types.ts
  • packages/effect/src/index.ts
  • packages/fetch/src/index.ts
  • packages/hono/src/index.test.ts
  • packages/hono/src/index.ts
  • packages/mcp/src/index.ts
  • packages/mock/src/msw/index.test.ts
  • packages/orval/src/generate-spec.test.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/query/src/mutation-generator.ts
  • packages/query/src/query-generator.ts
  • packages/swr/src/client.ts
  • packages/swr/src/index.ts
  • packages/zod/src/index.ts
  • packages/zod/src/zod.test.ts
  • tests/configs/axios.config.ts
  • tests/specifications/gateway-tuple.yaml
✅ Files skipped from review due to trivial changes (1)
  • packages/zod/src/zod.test.ts
🚧 Files skipped from review as they are similar to previous changes (23)
  • packages/angular/src/utils.test.ts
  • packages/mock/src/msw/index.test.ts
  • packages/swr/src/client.ts
  • packages/core/src/types.ts
  • packages/fetch/src/index.ts
  • docs/content/docs/reference/configuration/output.mdx
  • tests/configs/axios.config.ts
  • packages/effect/src/index.ts
  • packages/query/src/mutation-generator.ts
  • packages/mcp/src/index.ts
  • packages/axios/src/index.ts
  • packages/angular/src/http-client.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/angular/src/http-resource.ts
  • packages/hono/src/index.test.ts
  • packages/zod/src/index.ts
  • packages/query/src/query-generator.ts
  • packages/hono/src/index.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/angular/src/http-client.test.ts
  • packages/swr/src/index.ts
  • packages/angular/src/http-resource.test.ts

@aqeelat
aqeelat force-pushed the feat/3684-operationname-tuple-type-decoupling branch from f12241c to 3b1c4a8 Compare July 9, 2026 17:10

@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.

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 `@packages/orval/src/generate-spec.test.ts`:
- Around line 1305-1342: The tuple-returning operationName test is missing
coverage for the inventory method name, so it can still pass even if the first
tuple element is ignored for the second operation. Update the generate-spec test
in the operationName tuple case to also assert that the generated content
contains getProducts, alongside getItems and the result type names, so both
tuple elements are verified via operationName and generateSpec.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 49e0c8fe-f05f-41ab-9eb6-1c0ba85294f6

📥 Commits

Reviewing files that changed from the base of the PR and between f12241c and 3b1c4a8.

⛔ Files ignored due to path filters (9)
  • tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.ts is excluded by !**/__snapshots__/**
📒 Files selected for processing (26)
  • docs/content/docs/reference/configuration/output.mdx
  • packages/angular/src/http-client.test.ts
  • packages/angular/src/http-client.ts
  • packages/angular/src/http-resource.test.ts
  • packages/angular/src/http-resource.ts
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/core/src/types.ts
  • packages/effect/src/index.ts
  • packages/fetch/src/index.ts
  • packages/hono/src/index.test.ts
  • packages/hono/src/index.ts
  • packages/mcp/src/index.ts
  • packages/mock/src/msw/index.test.ts
  • packages/orval/src/generate-spec.test.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/query/src/mutation-generator.ts
  • packages/query/src/query-generator.ts
  • packages/swr/src/client.ts
  • packages/swr/src/index.ts
  • packages/zod/src/index.ts
  • packages/zod/src/zod.test.ts
  • tests/configs/axios.config.ts
  • tests/specifications/gateway-tuple.yaml
✅ Files skipped from review due to trivial changes (2)
  • docs/content/docs/reference/configuration/output.mdx
  • packages/angular/src/http-resource.test.ts
🚧 Files skipped from review as they are similar to previous changes (22)
  • packages/hono/src/index.test.ts
  • packages/angular/src/utils.test.ts
  • packages/angular/src/http-resource.ts
  • packages/core/src/types.ts
  • packages/swr/src/client.ts
  • packages/zod/src/index.ts
  • packages/fetch/src/index.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/mcp/src/index.ts
  • packages/axios/src/index.ts
  • packages/mock/src/msw/index.test.ts
  • tests/configs/axios.config.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/effect/src/index.ts
  • packages/angular/src/http-client.test.ts
  • packages/angular/src/http-client.ts
  • packages/query/src/mutation-generator.ts
  • packages/hono/src/index.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/swr/src/index.ts
  • packages/query/src/query-generator.ts
  • packages/zod/src/zod.test.ts

Comment thread packages/orval/src/generate-spec.test.ts
@aqeelat
aqeelat force-pushed the feat/3684-operationname-tuple-type-decoupling branch 2 times, most recently from 0ef27ef to 6371741 Compare July 9, 2026 17:23
@aqeelat

aqeelat commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai resume
@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@aqeelat: Resuming automatic reviews and kicking off a full review of all changes in this PR.

✅ Action performed

Reviews resumed.


Full review finished.

@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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/zod/src/index.ts (1)

2716-2716: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider renaming pascalOperationName to reflect its typeName source.

The variable now derives from typeName (line 2716) but is still called pascalOperationName, which is misleading. The same naming pattern appears in packages/hono/src/index.ts and packages/mcp/src/index.ts. Renaming to pascalTypeName (or similar) would prevent future confusion.

♻️ Suggested rename
- const pascalOperationName = pascal(typeName);
+ const pascalTypeName = pascal(typeName);

And update all references from pascalOperationName to pascalTypeName within the function.

🤖 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 `@packages/zod/src/index.ts` at line 2716, The local variable derived from
typeName in the relevant function is still named pascalOperationName, which is
misleading. Rename pascalOperationName to pascalTypeName (or another name that
reflects typeName) in the function that uses pascal(typeName), and update all
references to the new name consistently. Apply the same naming convention
wherever this pattern appears in the related index modules so the source of the
value is clear.
🤖 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 `@packages/axios/src/index.ts`:
- Line 98: The module-level returnTypesToWrite tracking in the axios generator
can collide across tags because it is keyed by operationName while the emitted
alias name now derives from pascal(typeName). Update the tag-split flow in
packages/axios/src/index.ts so each tag’s footer writes from its own isolated
state or clears returnTypesToWrite between tags, and verify the tuple-form path
still maps each operation to the correct *Result alias in the relevant generator
entry points.

---

Nitpick comments:
In `@packages/zod/src/index.ts`:
- Line 2716: The local variable derived from typeName in the relevant function
is still named pascalOperationName, which is misleading. Rename
pascalOperationName to pascalTypeName (or another name that reflects typeName)
in the function that uses pascal(typeName), and update all references to the new
name consistently. Apply the same naming convention wherever this pattern
appears in the related index modules so the source of the value is clear.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e32a75cf-09ec-40b5-a06b-582e84b6b8db

📥 Commits

Reviewing files that changed from the base of the PR and between 1134ba5 and 6371741.

⛔ Files ignored due to path filters (9)
  • tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.ts is excluded by !**/__snapshots__/**
📒 Files selected for processing (26)
  • docs/content/docs/reference/configuration/output.mdx
  • packages/angular/src/http-client.test.ts
  • packages/angular/src/http-client.ts
  • packages/angular/src/http-resource.test.ts
  • packages/angular/src/http-resource.ts
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/core/src/types.ts
  • packages/effect/src/index.ts
  • packages/fetch/src/index.ts
  • packages/hono/src/index.test.ts
  • packages/hono/src/index.ts
  • packages/mcp/src/index.ts
  • packages/mock/src/msw/index.test.ts
  • packages/orval/src/generate-spec.test.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/query/src/mutation-generator.ts
  • packages/query/src/query-generator.ts
  • packages/swr/src/client.ts
  • packages/swr/src/index.ts
  • packages/zod/src/index.ts
  • packages/zod/src/zod.test.ts
  • tests/configs/axios.config.ts
  • tests/specifications/gateway-tuple.yaml

Comment thread packages/axios/src/index.ts
@aqeelat
aqeelat force-pushed the feat/3684-operationname-tuple-type-decoupling branch from 6371741 to 9fa4a55 Compare July 9, 2026 19:38
@melloware

Copy link
Copy Markdown
Collaborator

@aqeelat merge conflicts now!

@aqeelat

aqeelat commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

@melloware one minute

@aqeelat
aqeelat force-pushed the feat/3684-operationname-tuple-type-decoupling branch 3 times, most recently from c23405f to 66154bb Compare July 12, 2026 12:22

@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.

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 `@packages/angular/src/http-resource.test.ts`:
- Around line 1592-1837: Update the createVerbOption fixture for searchPets to
set typeName to 'searchPets' alongside its existing operationName override,
matching the operation’s identity and the conventions used by the other
fixtures.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1a0f8bd7-d1cb-4f10-a126-4b7ba4b6afdd

📥 Commits

Reviewing files that changed from the base of the PR and between c23405f and 66154bb.

⛔ Files ignored due to path filters (9)
  • tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.ts is excluded by !**/__snapshots__/**
📒 Files selected for processing (26)
  • docs/content/docs/reference/configuration/output.mdx
  • packages/angular/src/http-client.test.ts
  • packages/angular/src/http-client.ts
  • packages/angular/src/http-resource.test.ts
  • packages/angular/src/http-resource.ts
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/core/src/types.ts
  • packages/effect/src/index.ts
  • packages/fetch/src/index.ts
  • packages/hono/src/index.test.ts
  • packages/hono/src/index.ts
  • packages/mcp/src/index.ts
  • packages/mock/src/msw/index.test.ts
  • packages/orval/src/generate-spec.test.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/query/src/mutation-generator.ts
  • packages/query/src/query-generator.ts
  • packages/swr/src/client.ts
  • packages/swr/src/index.ts
  • packages/zod/src/index.ts
  • packages/zod/src/zod.test.ts
  • tests/configs/axios.config.ts
  • tests/specifications/gateway-tuple.yaml
🚧 Files skipped from review as they are similar to previous changes (21)
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • tests/configs/axios.config.ts
  • packages/mcp/src/index.ts
  • docs/content/docs/reference/configuration/output.mdx
  • packages/hono/src/index.test.ts
  • packages/mock/src/msw/index.test.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/query/src/mutation-generator.ts
  • packages/core/src/types.ts
  • packages/angular/src/http-resource.ts
  • packages/swr/src/client.ts
  • packages/fetch/src/index.ts
  • packages/hono/src/index.ts
  • packages/angular/src/http-client.test.ts
  • packages/zod/src/index.ts
  • packages/angular/src/http-client.ts
  • packages/zod/src/zod.test.ts
  • packages/effect/src/index.ts
  • packages/swr/src/index.ts
  • packages/core/src/generators/verbs-options.ts

@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.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

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 `@packages/angular/src/http-resource.test.ts`:
- Around line 1592-1837: Update the createVerbOption fixture for searchPets to
set typeName to 'searchPets' alongside its existing operationName override,
matching the operation’s identity and the conventions used by the other
fixtures.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1a0f8bd7-d1cb-4f10-a126-4b7ba4b6afdd

📥 Commits

Reviewing files that changed from the base of the PR and between c23405f and 66154bb.

⛔ Files ignored due to path filters (9)
  • tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.ts is excluded by !**/__snapshots__/**
📒 Files selected for processing (26)
  • docs/content/docs/reference/configuration/output.mdx
  • packages/angular/src/http-client.test.ts
  • packages/angular/src/http-client.ts
  • packages/angular/src/http-resource.test.ts
  • packages/angular/src/http-resource.ts
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/core/src/types.ts
  • packages/effect/src/index.ts
  • packages/fetch/src/index.ts
  • packages/hono/src/index.test.ts
  • packages/hono/src/index.ts
  • packages/mcp/src/index.ts
  • packages/mock/src/msw/index.test.ts
  • packages/orval/src/generate-spec.test.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/query/src/mutation-generator.ts
  • packages/query/src/query-generator.ts
  • packages/swr/src/client.ts
  • packages/swr/src/index.ts
  • packages/zod/src/index.ts
  • packages/zod/src/zod.test.ts
  • tests/configs/axios.config.ts
  • tests/specifications/gateway-tuple.yaml
🚧 Files skipped from review as they are similar to previous changes (21)
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • tests/configs/axios.config.ts
  • packages/mcp/src/index.ts
  • docs/content/docs/reference/configuration/output.mdx
  • packages/hono/src/index.test.ts
  • packages/mock/src/msw/index.test.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/query/src/mutation-generator.ts
  • packages/core/src/types.ts
  • packages/angular/src/http-resource.ts
  • packages/swr/src/client.ts
  • packages/fetch/src/index.ts
  • packages/hono/src/index.ts
  • packages/angular/src/http-client.test.ts
  • packages/zod/src/index.ts
  • packages/angular/src/http-client.ts
  • packages/zod/src/zod.test.ts
  • packages/effect/src/index.ts
  • packages/swr/src/index.ts
  • packages/core/src/generators/verbs-options.ts
🛑 Comments failed to post (1)
packages/angular/src/http-resource.test.ts (1)

1592-1837: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Missing typeName override in searchPets fixture.

The createVerbOption call at line 1779 overrides operationName to 'searchPets' but does not override typeName, so it inherits the default 'getPetById'. Every other fixture in this file that overrides operationName also sets a matching typeName (e.g., lines 591, 647, 2075). This mismatch won't fail the current assertions but is semantically incorrect and could mask issues if the test is extended to verify generated type names.

🔧 Proposed fix
       const verbOption = createVerbOption({
         operationId: 'searchPets',
         operationName: 'searchPets',
+        typeName: 'searchPets',
         verb: 'post',
         route: '/pets/search',
         pathRoute: '/pets/search',
         params: [],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

      const verbOption = createVerbOption({
        operationId: 'searchPets',
        operationName: 'searchPets',
        typeName: 'searchPets',
        verb: 'post',
        route: '/pets/search',
        pathRoute: '/pets/search',
        params: [],
🤖 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 `@packages/angular/src/http-resource.test.ts` around lines 1592 - 1837, Update
the createVerbOption fixture for searchPets to set typeName to 'searchPets'
alongside its existing operationName override, matching the operation’s identity
and the conventions used by the other fixtures.

…method names (orval-labs#3684)

The override.operationName callback can now return [methodName, typeNameBase]
to independently control generated function/hook names from TypeScript type
identifier names (*Params, *Body, *Error, *Result, *Accept, zod/hono/effect
schema names). Returning a string (existing behavior) keeps both identical.

This enables gateway-aggregated specs with tags-split + splitByTags + indexFiles
where bare method names are safe per-tag but type names need global uniqueness
to avoid barrel-level TS2300 collisions.

Fully backward compatible — existing callbacks returning string work unchanged.
The tuple form is opt-in.
@aqeelat
aqeelat force-pushed the feat/3684-operationname-tuple-type-decoupling branch from 66154bb to 625641b Compare July 12, 2026 13:19

@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 (1)
packages/mcp/src/index.ts (1)

102-102: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Rename pascalOperationName to pascalTypeName for clarity.

The variable now derives from pascal(verbOption.typeName) but retains the old name pascalOperationName, which is misleading. Both the Effect generator (line 1449) and Zod generator (line 3008) use pascalTypeName for the same concept. Renaming would improve cross-generator consistency and prevent future confusion.

♻️ Proposed rename (3 occurrences)
-      const pascalOperationName = pascal(verbOption.typeName);
+      const pascalTypeName = pascal(verbOption.typeName);

Apply at lines 102, 256, and 316, then update all references from pascalOperationName to pascalTypeName within each scope.

Also applies to: 256-256, 316-316

🤖 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 `@packages/mcp/src/index.ts` at line 102, Rename pascalOperationName to
pascalTypeName at its declarations and update all references within the affected
scopes, including the occurrences around lines 102, 256, and 316, to align with
the existing generator naming convention.
🤖 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 `@packages/mcp/src/index.ts`:
- Line 102: Rename pascalOperationName to pascalTypeName at its declarations and
update all references within the affected scopes, including the occurrences
around lines 102, 256, and 316, to align with the existing generator naming
convention.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dd45b3db-3cce-4d71-ad65-eea0708f5ce1

📥 Commits

Reviewing files that changed from the base of the PR and between 66154bb and 625641b.

⛔ Files ignored due to path filters (9)
  • tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.ts is excluded by !**/__snapshots__/**
📒 Files selected for processing (26)
  • docs/content/docs/reference/configuration/output.mdx
  • packages/angular/src/http-client.test.ts
  • packages/angular/src/http-client.ts
  • packages/angular/src/http-resource.test.ts
  • packages/angular/src/http-resource.ts
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/core/src/types.ts
  • packages/effect/src/index.ts
  • packages/fetch/src/index.ts
  • packages/hono/src/index.test.ts
  • packages/hono/src/index.ts
  • packages/mcp/src/index.ts
  • packages/mock/src/msw/index.test.ts
  • packages/orval/src/generate-spec.test.ts
  • packages/orval/src/write-zod-specs.test.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/query/src/mutation-generator.ts
  • packages/query/src/query-generator.ts
  • packages/swr/src/client.ts
  • packages/swr/src/index.ts
  • packages/zod/src/index.ts
  • packages/zod/src/zod.test.ts
  • tests/configs/axios.config.ts
  • tests/specifications/gateway-tuple.yaml
🚧 Files skipped from review as they are similar to previous changes (15)
  • packages/orval/src/write-zod-specs.test.ts
  • packages/core/src/types.ts
  • packages/swr/src/client.ts
  • packages/angular/src/utils.test.ts
  • packages/axios/src/index.ts
  • packages/fetch/src/index.ts
  • packages/orval/src/write-zod-specs.ts
  • packages/angular/src/http-client.ts
  • packages/angular/src/http-resource.ts
  • packages/angular/src/http-client.test.ts
  • packages/query/src/query-generator.ts
  • packages/swr/src/index.ts
  • packages/core/src/generators/verbs-options.ts
  • packages/hono/src/index.ts
  • packages/zod/src/zod.test.ts

@melloware
melloware merged commit 4b334d2 into orval-labs:master Jul 12, 2026
8 checks passed
@aqeelat
aqeelat deleted the feat/3684-operationname-tuple-type-decoupling branch July 15, 2026 09:29
aqeelat added a commit to aqeelat/orval that referenced this pull request Jul 27, 2026
The gateway-tuple test config (added in orval-labs#3693) was relying on sanitize()
to strip {param} placeholders from the route — accidental coupling that
broke once overridden operationNames stopped being sanitized. Drop the
path-param route from the spec since it isn't what the test demonstrates.

Add tuple-form coverage for the $/_ preservation fix, asserting both
the methodName (verbatim) and the typeName (pascal-cased by getters)
land in the expected places.
melloware pushed a commit that referenced this pull request Jul 27, 2026
* fix(core): preserve overridden operationName verbatim

#3693 reintroduced the bug #2040 fixed: sanitize() was called on the
return value of a user-provided override.operationName callback,
stripping intentional '_' and '$' characters.

Skip sanitize when the value originates from the override callback (both
string and tuple forms), restoring PR #2040's contract that the override
is authoritative. Default (non-overridden) path keeps sanitize unchanged.

Closes #3775.

* test: add tuple-form coverage and fix gateway-tuple snapshot

The gateway-tuple test config (added in #3693) was relying on sanitize()
to strip {param} placeholders from the route — accidental coupling that
broke once overridden operationNames stopped being sanitized. Drop the
path-param route from the spec since it isn't what the test demonstrates.

Add tuple-form coverage for the $/_ preservation fix, asserting both
the methodName (verbatim) and the typeName (pascal-cased by getters)
land in the expected places.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: allow operationName override to decouple type names from method names

3 participants