-
-
Notifications
You must be signed in to change notification settings - Fork 275
Closed
Labels
bug 🔥Something isn't workingSomething isn't workingprioritized 🚚This issue has been prioritized and will be worked on soonThis issue has been prioritized and will be worked on soon
Description
Description
After updating to the latest version, TypeScript shows errors when using methodNameBuilder.
Default export of the module has or is using private name 'IROperationObject'.ts
Default export of the module has or is using private name 'Operation'.
Reproducible example or configuration
import { defineConfig } from '@hey-api/openapi-ts';
import { isNil } from 'lodash';
export default defineConfig({
input: 'http://localhost:5000/api/docs-json',
output: './lib',
parser: {
transforms: {
enums: false,
},
},
plugins: [
{
name: '@hey-api/client-fetch',
throwOnError: true,
baseUrl: false,
bundle: true,
},
{
name: '@hey-api/transformers',
dates: true,
},
{
name: '@hey-api/sdk',
transformer: true,
asClass: true,
classNameBuilder: (name: string) => `${name}Service`,
methodNameBuilder: (operation) => {
if ('operationId' in operation && !isNil(operation.operationId)) {
const parts = operation.operationId!.split('_');
if (parts.length === 1) {
return parts[0];
}
return parts[1];
}
if ('id' in operation && !isNil(operation.id)) {
return operation.id!;
}
return operation.path ?? '';
},
},
{
name: '@hey-api/typescript',
enums: 'typescript',
},
],
});
OpenAPI specification (optional)
No response
System information (optional)
No response
Copilot
Metadata
Metadata
Assignees
Labels
bug 🔥Something isn't workingSomething isn't workingprioritized 🚚This issue has been prioritized and will be worked on soonThis issue has been prioritized and will be worked on soon