Correct way to reference shared code in custom functions? #2278
Unanswered
rtkcthomson
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Is there a correct way to reference shared Javascript code between custom Spectral rule functions? We have some shared functions used in multiple custom Spectral rule functions that is in the
functionsdirectory beside the.jsfunctions they are used in, normalimport ... fromstatement. This works fine when we use the spectral-cli to execute the validation. However when we use the Visual Studio Code Spectral plugin (https://github.com/stoplightio/vscode-spectral) it fails to load the supporting.jsfiles successfully producing an error of the form:There is a <path_to_ruleset_directory>/functions/validationUtils.js file.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions