IBM/openapi-validator

Cannot read property '$ref' of undefined

Closed this issue · 7 comments

Need more mimingfull error description I have no clue what is wrong.

max@pop-os:~/ha/registry$ docker run --rm -v $(pwd)/specification:/data  jamescooke/openapi-validator -v --debug v2.yaml

[Error] There was a problem with a validator.
Cannot read property '$ref' of undefined

TypeError: Cannot read property '$ref' of undefined
    at reduceObj (/usr/local/lib/node_modules/ibm-openapi-validator/src/plugins/validation/2and3/semantic-validators/items-required-for-array-objects.js:17:10)
    at reduceObj (/usr/local/lib/node_modules/ibm-openapi-validator/src/plugins/validation/2and3/semantic-validators/items-required-for-array-objects.js:20:12)
    at checkReqProp (/usr/local/lib/node_modules/ibm-openapi-validator/src/plugins/validation/2and3/semantic-validators/items-required-for-array-objects.js:26:9)
    at /usr/local/lib/node_modules/ibm-openapi-validator/src/plugins/validation/2and3/semantic-validators/items-required-for-array-objects.js:33:12
    at Array.forEach (<anonymous>)
    at checkReqProp (/usr/local/lib/node_modules/ibm-openapi-validator/src/plugins/validation/2and3/semantic-validators/items-required-for-array-objects.js:32:15)
    at /usr/local/lib/node_modules/ibm-openapi-validator/src/plugins/validation/2and3/semantic-validators/items-required-for-array-objects.js:79:16
    at Array.forEach (<anonymous>)
    at /usr/local/lib/node_modules/ibm-openapi-validator/src/plugins/validation/2and3/semantic-validators/items-required-for-array-objects.js:78:22
    at walk (/usr/local/lib/node_modules/ibm-openapi-validator/src/plugins/utils/walk.js:17:3)

I agree. I'm not sure what to make of this yet.

Are you able to provide v2.yaml, so I can take a look?

Okay but I don't want to make the API public. Can I share the API via email?
@barrett-schonefeld send me your email if it's an option I'll send it to your email.

@Legion112 You can send the API to the email on my profile and I can share with Barrett internally.

Or, if it's easy enough, you could post a small API definition snippet that captures the problem in this thread

@dpopp07
I have sent you the OpenAPI specification. Please let me know when you take a look.

Any progress on this issues?

@Legion112 I apologize for the delay. I have been unable to reproduce the issue with the API you sent me. What version of the tool are you using?

I just pull the new latest image jamescooke/openapi-validator:b32a7e51815a it does work now.
Thank a lot for quick fix