Mermade / openapi-filter

Filter internal paths, operations, parameters, schemas etc from OpenAPI/Swagger/AsyncAPI definitions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3.2.1 update broke running through npx

ProstoSanja opened this issue · comments

Since yesterday cant run the script neither in CI pipelines, nor on a local machine;

Need to install the following packages:
  openapi-filter@3.2.1
Ok to proceed? (y) y
node:internal/modules/cjs/loader:557
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './types' is not defined by "exports" in /__REDACTED__/.npm/_npx/b725999c9659cba2/node_modules/yaml/package.json
    at new NodeError (node:internal/errors:399:5)
    at exportsNotFound (node:internal/modules/esm/resolve:266:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:602:9)
    at resolveExports (node:internal/modules/cjs/loader:551:36)
    at Module._findPath (node:internal/modules/cjs/loader:620:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1039:27)
    at Module._load (node:internal/modules/cjs/loader:898:27)
    at Module.require (node:internal/modules/cjs/loader:1120:19)
    at require (node:internal/modules/helpers:112:18)
    at Object.<anonymous> (/__REDACTED__/.npm/_npx/b725999c9659cba2/node_modules/openapi-filter/openapi-filter.js:7:22) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Have you got any guesses as to what might be causing this? Are you using TypeScript?

For now, can you pin to v3.2.0?

same here

it works when forcing the version to be 3.2.0.

Hmm, reproducible here. When I did npx openapi-filter I got the error message as above.

It may be a bug in node/npm...

In node 14, the error looks like this:

Package subpath './types' is not defined by "exports" in /Users/mikeralphson/.npm/_npx/85678/lib/node_modules/openapi-filter/node_modules/yaml/package.json

So it's a problem in the yaml dependency. I'm going to try to fix and re-publish with a regenerated package-lock.json file.

I think v3.2.2 should be working. Please could you confirm @lsoares @ProstoSanja @DenisHomich @localstatic ? Sorry about the issue and thanks for using openapi-filter.

great! The good news is that it's solved.
npx openapi-filter --flags x-newstore-category --flagValues public --inverse --strip --valid -- openapi.yaml inventory_manager_api.yaml

now I get this:
Not enough non-option arguments: got 0, need at least 1
did the API change?

No, that's probably an incompatibility with the later version of yargs. I'll fix it tomorrow, sorry.

no problem! thanks for the update!

Version 3.2.3 published, fixing this and an unrelated infinite loop bug. Hopefully this time is the charm.

works! thx 😀