Skip to content

Commit aaeefa1

Browse files
authored
fix(ama-openapi): path to the model to load (#3964)
## Proposed change <!-- Please include a summary of the changes and the related issue. Please also include relevant motivation and context. --> ## Related issues <!-- Please make sure to follow the [contribution guidelines](https://github.com/amadeus-digital/Otter/blob/main/CONTRIBUTING.md) --> *- No issue associated -* <!-- * 🐛 Fix #issue --> <!-- * 🐛 Fix resolves #issue --> <!-- * 🚀 Feature #issue --> <!-- * 🚀 Feature resolves #issue --> <!-- * :octocat: Pull Request #issue -->
2 parents 8539c91 + 11920f2 commit aaeefa1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/@ama-openapi/core/src/core/manifest/extract-dependency-models.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ const extractDependencyModelsSimple = async (
138138
const path = typeof modelName === 'string' ? modelName : artifactName;
139139
const { filePath, innerPath } = splitModelPath(path);
140140
const modelPath = typeof modelName === 'string' ? join(artifactBasePath, filePath) : require.resolve(artifactName);
141-
const content = await fs.readFile(filePath, { encoding: 'utf8' });
141+
const content = await fs.readFile(modelPath, { encoding: 'utf8' });
142142
const model = { path } satisfies Model;
143143
const fileNameOutput = getOutFilePathFromModelPath(model.path);
144144
const outputFilePath = resolve(cwd, outputDirectory, sanitizePackagePath(artifactName), fileNameOutput);
@@ -180,8 +180,8 @@ export const extractDependencyModelsObject = async (
180180
const path = model.path || require.resolve(artifactName).split(artifactName)[1];
181181
const { filePath, innerPath } = splitModelPath(path);
182182
const modelPath = model.path ? join(artifactBasePath, filePath) : require.resolve(artifactName);
183-
const content = await fs.readFile(filePath, { encoding: 'utf8' });
184-
logger?.debug?.(`extracting model ${modelPath} from ${outputDirectory}`);
183+
const content = await fs.readFile(modelPath, { encoding: 'utf8' });
184+
logger?.debug?.(`extracting model ${modelPath} to ${outputDirectory}`);
185185

186186
const fileNameOutput = transform?.rename
187187
? filePath.replace(new RegExp(`(${basename(filePath).replaceAll('.', '\\.')})$`), transform.rename)

0 commit comments

Comments
 (0)