diff --git a/packages/model-generator/src/generate_api_code.ts b/packages/model-generator/src/generate_api_code.ts index 4ad44f68f4..6841ef8bbf 100644 --- a/packages/model-generator/src/generate_api_code.ts +++ b/packages/model-generator/src/generate_api_code.ts @@ -77,7 +77,15 @@ export const generateApiCode = async ( target: props.typeTarget, multipleSwiftFiles: props.multipleSwiftFiles, }); - return { ...documents, ...types }; + + return { + writeToDirectory: async (directoryPath: string) => { + await Promise.all([ + documents.writeToDirectory(directoryPath), + types.writeToDirectory(directoryPath), + ]); + }, + }; } return documents;