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',
},
],
});
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
OpenAPI specification (optional)
No response
System information (optional)
No response