Closed RobinTail closed 10 months ago
The CI fails to run
> openapi3-ts-test@1.0.0 test:ts-esm
> ts-node --esm --project fixture/tsconfig.node.json index.ts
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/runner/work/openapi3-ts/openapi3-ts/test/index.ts
at new NodeError (node:internal/errors:405:5)
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:136:11)
at defaultGetFormat (node:internal/modules/esm/get_format:182:36)
at defaultLoad (node:internal/modules/esm/load:101:20)
at nextLoad (node:internal/modules/esm/hooks:864:28)
at load (/home/runner/work/openapi3-ts/openapi3-ts/test/node_modules/ts-node/dist/child/child-loader.js:19:122)
at nextLoad (node:internal/modules/esm/hooks:864:28)
at Hooks.load (node:internal/modules/esm/hooks:447:26)
at MessagePort.handleMessage (node:internal/modules/esm/worker:196:24)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:786:20) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
Consider switching to tsx
@pjmolina , please review. I tried to collect as much information about those fields as possible into the JSDOC. However, the PR is open for your edits.
Sure, @pjmolina , I can improve it accordingly.
Can we replace in full ts-node to use tsx? Just to avoid having 2 dependencies for the same task. Can you move these tools from the dependencies to dev-dependencies block as they are not needed for distribution?
All done, @pjmolina .
ts-node
removed from the test
environment;tsx
in CJS mode is ensured by the cts
file extension;tsx
moved to devDependencies
.Thanks @RobinTail Published in v. 4.2.0 https://www.npmjs.com/package/openapi3-ts?activeTab=versions
Adding two new fields to the SchemaObject of 3.1. The
contentEncoding
is supposed to override theformat
(such asbinary
) for the case of file transfer. ThecontentMediaType
is optional when defined as a key ofContentObject
but it's JSON Schema compliant.First appearance in 3.1.0 RC0: https://github.com/OAI/OpenAPI-Specification/releases/tag/3.1.0-rc0
Documentation: https://swagger.io/specification/?#considerations-for-file-uploads