Skip to content

Commit 5f20a24

Browse files
committed
methodName
1 parent 206f886 commit 5f20a24

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

packages/openapi-ts/src/plugins/@orpc/contract/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ function resolveRouter(
2929
},
3030
mappers: {
3131
object(value) {
32-
value.keyName = context.valueToObject({
32+
value.methodName = context.valueToObject({
3333
defaultValue: { casing: 'camelCase' },
3434
mappers: {
3535
function: (name) => ({ name }),
3636
string: (name) => ({ name }),
3737
},
38-
value: value.keyName,
38+
value: value.methodName,
3939
});
4040
value.segmentName = context.valueToObject({
4141
defaultValue: { casing: 'camelCase' },
@@ -57,7 +57,7 @@ export const defaultConfig: OrpcContractPlugin['Config'] = {
5757
contractNameBuilder: (id: string) => `${id}Contract`,
5858
exportFromIndex: false,
5959
router: {
60-
keyName: { casing: 'camelCase' },
60+
methodName: { casing: 'camelCase' },
6161
nesting: 'operationId',
6262
nestingDelimiters: /[./]/,
6363
segmentName: { casing: 'camelCase' },

packages/openapi-ts/src/plugins/@orpc/contract/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export const handler: OrpcContractPlugin['Handler'] = ({ plugin }) => {
242242
for (let i = 0; i < path.length; i++) {
243243
const isLast = i === path.length - 1;
244244
const segment = isLast
245-
? applyNaming(path[i]!, router.keyName)
245+
? applyNaming(path[i]!, router.methodName)
246246
: applyNaming(path[i]!, router.segmentName);
247247

248248
if (isLast) {

packages/openapi-ts/src/plugins/@orpc/contract/types.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import type { NamingConfig, NamingRule } from '~/utils/naming';
88

99
export interface UserRouterConfig {
1010
/**
11-
* Customize key names for operations in the router.
11+
* Customize method/key names for operations in the router.
1212
*
13-
* Applied to the final segment of the path (the key name).
13+
* Applied to the final segment of the path.
1414
*/
15-
keyName?: NamingRule;
15+
methodName?: NamingRule;
1616
/**
1717
* How to derive nesting structure from operations.
1818
*
@@ -60,11 +60,11 @@ export interface UserRouterConfig {
6060

6161
export interface RouterConfig {
6262
/**
63-
* Customize key names for operations in the router.
63+
* Customize method/key names for operations in the router.
6464
*
65-
* Applied to the final segment of the path (the key name).
65+
* Applied to the final segment of the path.
6666
*/
67-
keyName: NamingConfig;
67+
methodName: NamingConfig;
6868
/**
6969
* How to derive nesting structure from operations.
7070
*
@@ -133,7 +133,7 @@ export type UserConfig = Plugin.Name<'@orpc/contract'> &
133133
* strategy: 'byTags',
134134
* nesting: 'operationId',
135135
* segmentName: { casing: 'camelCase' },
136-
* keyName: { casing: 'camelCase' },
136+
* methodName: { casing: 'camelCase' },
137137
* }
138138
*/
139139
router?: OperationsStrategy | UserRouterConfig;

0 commit comments

Comments
 (0)