openapi-typescript-codegen/src/utils/postProcessService.ts
2022-01-25 13:22:21 +01:00

14 lines
552 B
TypeScript

import type { Service } from '../client/interfaces/Service';
import { postProcessServiceImports } from './postProcessServiceImports';
import { postProcessServiceOperations } from './postProcessServiceOperations';
export const postProcessService = (service: Service): Service => {
const clone = { ...service };
clone.operations = postProcessServiceOperations(clone);
clone.operations.forEach(operation => {
clone.imports.push(...operation.imports);
});
clone.imports = postProcessServiceImports(clone);
return clone;
};