Skip to content

Commit 443b16f

Browse files
committed
refactor: logWarn when can't parse sourceFile
DX-658
1 parent bf2aae8 commit 443b16f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/openapi-generator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ containing AST definitions for external libraries. For more details, see
102102
### Solution 2: Using a Custom Codec Configuration File
103103

104104
`openapi-generator` supports importing codecs from other packages in `node_modules`, but
105-
it struggles with `io-ts` primitives that need JavaScript interpretation, such as
105+
it struggles with `io-ts`primitives that need JavaScript interpretation, such as
106106
`new t.Type(...)`. To work around this, you can define schemas for these codecs in a
107107
configuration file within your downstream types package (where you generate the API
108108
docs). This allows the generator to understand and use these schemas where necessary.

packages/openapi-generator/src/sourceFile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as swc from '@swc/core';
22

33
import { parseTopLevelSymbols, type SymbolTable } from './symbol';
4-
import { logError } from './error';
4+
import { logWarn } from './error';
55

66
export type SourceFile = {
77
path: string;
@@ -42,7 +42,7 @@ export async function parseSource(
4242
span: module.span,
4343
};
4444
} catch (e: unknown) {
45-
logError(`Error parsing source file: ${path}, ${e}`);
45+
logWarn(`Error parsing source file: ${path}, ${e}`);
4646
return undefined;
4747
}
4848
}

0 commit comments

Comments
 (0)