feat(core): allow operationName override to decouple type names from method names - #3693
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR adds tuple-return support for ChangesType-name decoupling feature
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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
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. Comment |
There was a problem hiding this comment.
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
verbhelper is missing the requiredtypeNamefield.The
verbhelper createsGeneratorVerbOptionswithouttypeName. Since the Hono generator now callspascal(verbOption.typeName), verbs from this helper would yieldpascal(undefined) = '', producing unprefixed context type names (e.g.,export type Context<...>instead ofListPetsContext<...>). This shadows the importedContextfromhonoand would break any test that checks for specific type names. TheformVerbfixture was correctly updated withtypeName, 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 valueParameter names in
getAcceptHelperNameandbuildAcceptHelperare now misleading.Both functions declare their first parameter as
operationName, but they are now called withtypeNamevalues (lines 203 and 478). Consider renaming to a neutral name likenameBaseortypeNameBaseto 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 valueRename stale
operationNameparameter totypeName.
fetchResponseTypeName's third parameter is still namedoperationName, but every call site (line 329) now passestypeName. 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 valueTest 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:
The
caphelper is duplicated across four test cases (lines 1317, 1390, 1443) and intests/configs/axios.config.ts. Consider extracting it to a shared helper.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
⛔ Files ignored due to path filters (9)
tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.tsis excluded by!**/__snapshots__/**
📒 Files selected for processing (25)
docs/content/docs/reference/configuration/output.mdxpackages/angular/src/http-client.test.tspackages/angular/src/http-client.tspackages/angular/src/http-resource.test.tspackages/angular/src/http-resource.tspackages/angular/src/utils.test.tspackages/axios/src/index.tspackages/core/src/generators/verbs-options.tspackages/core/src/types.tspackages/effect/src/index.tspackages/fetch/src/index.tspackages/hono/src/index.test.tspackages/hono/src/index.tspackages/mcp/src/index.tspackages/mock/src/msw/index.test.tspackages/orval/src/generate-spec.test.tspackages/orval/src/write-zod-specs.test.tspackages/orval/src/write-zod-specs.tspackages/query/src/mutation-generator.tspackages/query/src/query-generator.tspackages/swr/src/index.tspackages/zod/src/index.tspackages/zod/src/zod.test.tstests/configs/axios.config.tstests/specifications/gateway-tuple.yaml
@orval/angular
@orval/axios
@orval/core
@orval/effect
@orval/fetch
@orval/hono
@orval/mcp
@orval/mock
orval
@orval/query
@orval/solid-start
@orval/swr
@orval/zod
commit: |
39c65a8 to
0a09968
Compare
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 `@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
⛔ Files ignored due to path filters (9)
tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.tsis excluded by!**/__snapshots__/**
📒 Files selected for processing (25)
docs/content/docs/reference/configuration/output.mdxpackages/angular/src/http-client.test.tspackages/angular/src/http-client.tspackages/angular/src/http-resource.test.tspackages/angular/src/http-resource.tspackages/angular/src/utils.test.tspackages/axios/src/index.tspackages/core/src/generators/verbs-options.tspackages/core/src/types.tspackages/effect/src/index.tspackages/fetch/src/index.tspackages/hono/src/index.test.tspackages/hono/src/index.tspackages/mcp/src/index.tspackages/mock/src/msw/index.test.tspackages/orval/src/generate-spec.test.tspackages/orval/src/write-zod-specs.test.tspackages/orval/src/write-zod-specs.tspackages/query/src/mutation-generator.tspackages/query/src/query-generator.tspackages/swr/src/index.tspackages/zod/src/index.tspackages/zod/src/zod.test.tstests/configs/axios.config.tstests/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
0a09968 to
173143a
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/orval/src/generate-spec.test.ts (1)
1264-1471: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueTests 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_SPECfixture is minimal but sufficient. Thetry/finallycleanup pattern is correct.One minor observation: the
caphelper is duplicated across three test cases (lines 1317-1318, 1390-1391, 1445-1446). Consider extracting it to a shared local within thedescribeblock.♻️ 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
⛔ Files ignored due to path filters (9)
tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.tsis excluded by!**/__snapshots__/**
📒 Files selected for processing (26)
docs/content/docs/reference/configuration/output.mdxpackages/angular/src/http-client.test.tspackages/angular/src/http-client.tspackages/angular/src/http-resource.test.tspackages/angular/src/http-resource.tspackages/angular/src/utils.test.tspackages/axios/src/index.tspackages/core/src/generators/verbs-options.tspackages/core/src/types.tspackages/effect/src/index.tspackages/fetch/src/index.tspackages/hono/src/index.test.tspackages/hono/src/index.tspackages/mcp/src/index.tspackages/mock/src/msw/index.test.tspackages/orval/src/generate-spec.test.tspackages/orval/src/write-zod-specs.test.tspackages/orval/src/write-zod-specs.tspackages/query/src/mutation-generator.tspackages/query/src/query-generator.tspackages/swr/src/client.tspackages/swr/src/index.tspackages/zod/src/index.tspackages/zod/src/zod.test.tstests/configs/axios.config.tstests/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
173143a to
f12241c
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/orval/src/generate-spec.test.ts (2)
1428-1467: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider asserting the inventory hook name in the SWR test.
The test verifies
useGetItemsfor the catalog endpoint and both error type names, but doesn't assert the inventory SWR hook nameuseGetProducts. 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 valueConsider strengthening the backward-compatibility test.
The
operationNameoverride returns${verb}Productsfor both operations, so both the catalog and inventory endpoints receive the same namegetProducts. The test only assertstoContain('getProducts')andtoContain('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
⛔ Files ignored due to path filters (9)
tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.tsis excluded by!**/__snapshots__/**
📒 Files selected for processing (26)
docs/content/docs/reference/configuration/output.mdxpackages/angular/src/http-client.test.tspackages/angular/src/http-client.tspackages/angular/src/http-resource.test.tspackages/angular/src/http-resource.tspackages/angular/src/utils.test.tspackages/axios/src/index.tspackages/core/src/generators/verbs-options.tspackages/core/src/types.tspackages/effect/src/index.tspackages/fetch/src/index.tspackages/hono/src/index.test.tspackages/hono/src/index.tspackages/mcp/src/index.tspackages/mock/src/msw/index.test.tspackages/orval/src/generate-spec.test.tspackages/orval/src/write-zod-specs.test.tspackages/orval/src/write-zod-specs.tspackages/query/src/mutation-generator.tspackages/query/src/query-generator.tspackages/swr/src/client.tspackages/swr/src/index.tspackages/zod/src/index.tspackages/zod/src/zod.test.tstests/configs/axios.config.tstests/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
f12241c to
3b1c4a8
Compare
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 `@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
⛔ Files ignored due to path filters (9)
tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.tsis excluded by!**/__snapshots__/**
📒 Files selected for processing (26)
docs/content/docs/reference/configuration/output.mdxpackages/angular/src/http-client.test.tspackages/angular/src/http-client.tspackages/angular/src/http-resource.test.tspackages/angular/src/http-resource.tspackages/angular/src/utils.test.tspackages/axios/src/index.tspackages/core/src/generators/verbs-options.tspackages/core/src/types.tspackages/effect/src/index.tspackages/fetch/src/index.tspackages/hono/src/index.test.tspackages/hono/src/index.tspackages/mcp/src/index.tspackages/mock/src/msw/index.test.tspackages/orval/src/generate-spec.test.tspackages/orval/src/write-zod-specs.test.tspackages/orval/src/write-zod-specs.tspackages/query/src/mutation-generator.tspackages/query/src/query-generator.tspackages/swr/src/client.tspackages/swr/src/index.tspackages/zod/src/index.tspackages/zod/src/zod.test.tstests/configs/axios.config.tstests/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
0ef27ef to
6371741
Compare
|
@coderabbitai resume |
|
✅ Action performedReviews resumed. Full review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/zod/src/index.ts (1)
2716-2716: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider renaming
pascalOperationNameto reflect itstypeNamesource.The variable now derives from
typeName(line 2716) but is still calledpascalOperationName, which is misleading. The same naming pattern appears inpackages/hono/src/index.tsandpackages/mcp/src/index.ts. Renaming topascalTypeName(or similar) would prevent future confusion.♻️ Suggested rename
- const pascalOperationName = pascal(typeName); + const pascalTypeName = pascal(typeName);And update all references from
pascalOperationNametopascalTypeNamewithin 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
⛔ Files ignored due to path filters (9)
tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.tsis excluded by!**/__snapshots__/**
📒 Files selected for processing (26)
docs/content/docs/reference/configuration/output.mdxpackages/angular/src/http-client.test.tspackages/angular/src/http-client.tspackages/angular/src/http-resource.test.tspackages/angular/src/http-resource.tspackages/angular/src/utils.test.tspackages/axios/src/index.tspackages/core/src/generators/verbs-options.tspackages/core/src/types.tspackages/effect/src/index.tspackages/fetch/src/index.tspackages/hono/src/index.test.tspackages/hono/src/index.tspackages/mcp/src/index.tspackages/mock/src/msw/index.test.tspackages/orval/src/generate-spec.test.tspackages/orval/src/write-zod-specs.test.tspackages/orval/src/write-zod-specs.tspackages/query/src/mutation-generator.tspackages/query/src/query-generator.tspackages/swr/src/client.tspackages/swr/src/index.tspackages/zod/src/index.tspackages/zod/src/zod.test.tstests/configs/axios.config.tstests/specifications/gateway-tuple.yaml
6371741 to
9fa4a55
Compare
|
@aqeelat merge conflicts now! |
|
@melloware one minute |
c23405f to
66154bb
Compare
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 `@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
⛔ Files ignored due to path filters (9)
tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.tsis excluded by!**/__snapshots__/**
📒 Files selected for processing (26)
docs/content/docs/reference/configuration/output.mdxpackages/angular/src/http-client.test.tspackages/angular/src/http-client.tspackages/angular/src/http-resource.test.tspackages/angular/src/http-resource.tspackages/angular/src/utils.test.tspackages/axios/src/index.tspackages/core/src/generators/verbs-options.tspackages/core/src/types.tspackages/effect/src/index.tspackages/fetch/src/index.tspackages/hono/src/index.test.tspackages/hono/src/index.tspackages/mcp/src/index.tspackages/mock/src/msw/index.test.tspackages/orval/src/generate-spec.test.tspackages/orval/src/write-zod-specs.test.tspackages/orval/src/write-zod-specs.tspackages/query/src/mutation-generator.tspackages/query/src/query-generator.tspackages/swr/src/client.tspackages/swr/src/index.tspackages/zod/src/index.tspackages/zod/src/zod.test.tstests/configs/axios.config.tstests/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
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (9)
tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.tsis excluded by!**/__snapshots__/**
📒 Files selected for processing (26)
docs/content/docs/reference/configuration/output.mdxpackages/angular/src/http-client.test.tspackages/angular/src/http-client.tspackages/angular/src/http-resource.test.tspackages/angular/src/http-resource.tspackages/angular/src/utils.test.tspackages/axios/src/index.tspackages/core/src/generators/verbs-options.tspackages/core/src/types.tspackages/effect/src/index.tspackages/fetch/src/index.tspackages/hono/src/index.test.tspackages/hono/src/index.tspackages/mcp/src/index.tspackages/mock/src/msw/index.test.tspackages/orval/src/generate-spec.test.tspackages/orval/src/write-zod-specs.test.tspackages/orval/src/write-zod-specs.tspackages/query/src/mutation-generator.tspackages/query/src/query-generator.tspackages/swr/src/client.tspackages/swr/src/index.tspackages/zod/src/index.tspackages/zod/src/zod.test.tstests/configs/axios.config.tstests/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
typeNameoverride insearchPetsfixture.The
createVerbOptioncall at line 1779 overridesoperationNameto'searchPets'but does not overridetypeName, so it inherits the default'getPetById'. Every other fixture in this file that overridesoperationNamealso sets a matchingtypeName(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.
66154bb to
625641b
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/mcp/src/index.ts (1)
102-102: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRename
pascalOperationNametopascalTypeNamefor clarity.The variable now derives from
pascal(verbOption.typeName)but retains the old namepascalOperationName, which is misleading. Both the Effect generator (line 1449) and Zod generator (line 3008) usepascalTypeNamefor 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
pascalOperationNametopascalTypeNamewithin 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
⛔ Files ignored due to path filters (9)
tests/__snapshots__/axios/gateway-tuple-tags-split/catalog/catalog.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/inventory/inventory.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/getCatalogProductsParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/catalog/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/getInventoryStockParams.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/inventory/index.tsis excluded by!**/__snapshots__/**tests/__snapshots__/axios/gateway-tuple-tags-split/model/product.tsis excluded by!**/__snapshots__/**
📒 Files selected for processing (26)
docs/content/docs/reference/configuration/output.mdxpackages/angular/src/http-client.test.tspackages/angular/src/http-client.tspackages/angular/src/http-resource.test.tspackages/angular/src/http-resource.tspackages/angular/src/utils.test.tspackages/axios/src/index.tspackages/core/src/generators/verbs-options.tspackages/core/src/types.tspackages/effect/src/index.tspackages/fetch/src/index.tspackages/hono/src/index.test.tspackages/hono/src/index.tspackages/mcp/src/index.tspackages/mock/src/msw/index.test.tspackages/orval/src/generate-spec.test.tspackages/orval/src/write-zod-specs.test.tspackages/orval/src/write-zod-specs.tspackages/query/src/mutation-generator.tspackages/query/src/query-generator.tspackages/swr/src/client.tspackages/swr/src/index.tspackages/zod/src/index.tspackages/zod/src/zod.test.tstests/configs/axios.config.tstests/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
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.
* 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.
Problem
When
override.operationNamestrips path segments to produce clean method names, all operation-specific type identifiers (*Params,*Body,*Error,*Result) derive from the stripped name. Withtags-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
operationNamecallback return type fromstringtostring | [string, string]. Returning[methodName, typeNameBase]decouples function/hook names from type-identifier names. Fully backward compatible — existing callbacks returningstringwork unchanged.Changes
GeneratorVerbOptionsgains atypeNamefield (defaults tooperationNamewhen no tuple is returned)*Params,*Body,*Error,*Result,*Accept, zod/hono/effect schema names) usetypeNameoperationNamegetResponse,getBody,getQueryParams,getProps) receivetypeNameas the name basegenerateMutatorreceivestypeNamesoerrorTypeName/bodyTypeNamematchTests
Notes
returnTypesToWritemodule-level map bug in axios tracked separately in bug(axios): module-level returnTypesToWrite map causes wrong *Result type in tags-split mode #3685operationsmap inclient.tskeys byoperationName— same-name methods across paths still collide at the map level. This is a separate pre-existing limitation.Summary by CodeRabbit
override.operationNamecan now returnstringor[methodName, typeName]to independently control generated endpoint/hook names vs result/schema/type identifiers, including tag-split outputs.