Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: noun function should always return list #34

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

iwong-isp
Copy link
Contributor

@iwong-isp iwong-isp commented Jun 23, 2023

The following error gets thrown if the noun function found no errors in the openAPI spec because it currently returns null. This PR modifies the function to always return the list even if empty.

TypeError: Cannot use 'in' operator to search for 'then' in null
    at Object.exports.lintNode (/action/node_modules/@stoplight/spectral/dist/runner/lintNode.js:40:24)
    at callback (/action/node_modules/@stoplight/spectral/dist/runner/runner.js:38:32)
    at JSONPath._handleCallback (/action/node_modules/jsonpath-plus/dist/index-umd.js:626:7)
    at JSONPath._trace (/action/node_modules/jsonpath-plus/dist/index-umd.js:728:12)
    at JSONPath._trace (/action/node_modules/jsonpath-plus/dist/index-umd.js:689:19)
    at /action/node_modules/jsonpath-plus/dist/index-umd.js:693:21
    at /action/node_modules/jsonpath-plus/dist/index-umd.js:909:9
    at Array.forEach (<anonymous>)
    at JSONPath._walk (/action/node_modules/jsonpath-plus/dist/index-umd.js:908:24)
    at JSONPath._trace (/action/node_modules/jsonpath-plus/dist/index-umd.js:692:12)

@iwong-isp iwong-isp merged commit a0350a2 into master Jun 26, 2023
1 check passed
@iwong-isp iwong-isp deleted the noun-return-errors-array branch June 26, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants