IBM / openapi-validator

Configurable and extensible validator/linter for OpenAPI documents
Apache License 2.0
481 stars 88 forks source link

Failed to resolve entry for package "ibm-openapi-validator #640

Closed melloware closed 10 months ago

melloware commented 10 months ago

We use your project in Orval an OpenAPI to Typscript generator.

https://github.com/anymaniax/orval

We are using 0.97.5 which works but when trying to upgrade we get the following error:

Error: Failed to resolve entry for package "ibm-openapi-validator". 
The package may have incorrect main/module/exports specified in its package.json: 
Failed to resolve entry for package "ibm-openapi-validator". The package may have incorrect main/module/exports specified in its package.json.

It looks like the line "main": "src/lib/index.js", was removed from your package.json?

dpopp07 commented 10 months ago

Hi @melloware - I'm glad the tool has been useful to you. Yes, with v1 we removed support for direct usage within a Node module.

The Node module portion of the tool was essentially just a wrapper around our validation functionality. We've formatted our validation functionality, rules, and ruleset to be compatible with Spectral, another tool that has a robust API for Node module usage. We now recommend importing our ruleset package (see the docs for programmatic usage) and then using Spectral in your JS code to run our rules.

For other changes in v1, see our migration guide.

I'm going to close the issue, as this is intentional behavior, but please feel free to continue asking any questions as you have them!

melloware commented 10 months ago

Thank you @dpopp07 exactly what I needed.