Open webketje opened 1 year ago
plz submit a PR
The same issue also exists for OpenAPIRequestValidator
and OpenAPIRequestCoercer
. As mentioned by the reporter, using
new OpenAPIRequestValidator.default(...)
new OpenAPIResponseValidator.default(...)
new OpenAPIRequestCoercer.default(...)
instead of
new OpenAPIRequestValidator(...)
new OpenAPIResponseValidator(...)
new OpenAPIRequestCoercer(...)
is a workaround for ESM projects. For CommonJS projects, the workaround is not necessary.
same issue with import OpenAPISchemaValidator from 'openapi-schema-validator'
, workarounds not working. Property 'default' does not exist on type 'typeof OpenAPISchemaValidator'
Context
.js
)Bug
Temp fixes
(clunky, TS types intellisense no longer working in VS Code)
or (in generated code, not clean but working) Replace following statements
with
Solution
Provide different entrypoints in
dist
and expose them to the relevant environments usingpackage.json
main
,module
andexports
fields. Alternatively, manually wrap output in a UMD wrapper