This package contains a number of JS functions that may be useful in developing a custom Spectral ruleset for validating OpenAPI documents.
npm install @ibm-cloud/openapi-ruleset-utilities
See this page for comprehensive documentation on all functionality available in this package.