-
Notifications
You must be signed in to change notification settings - Fork 87
Description
I'm running contract tests using CATS and encountered an issue when array definitions in the OpenAPI specification have an empty items field or are missing it entirely. This causes a NullPointerException and crashes the test process.
For example, this field in the OpenAPI spec:
"QueryRestarted": {
"example": [],
"items": {},
"maxItems": 0,
"type": "array"
}
The items field is present but empty, which leads to the error. The empty items field should be considered valid according to OpenAPI, but it causes the tests to fail unexpectedly with CATS.
Steps to Reproduce:
- Define an array in the OpenAPI specification with an empty
itemsfield or a missingitemsfield. - Run the contract tests using CATS.
- Observe the
NullPointerExceptionerror.
Expected Behavior:
CATS should be able to handle an empty or missing items field without crashing. The spec itself should be considered valid.
Actual Behavior:
CATS throws a NullPointerException, which results in the test process crashing.
Suggested Action:
We would appreciate it if you could investigate the issue with the empty items field causing a NullPointerException and suggest any workarounds or fixes for handling this scenario in CATS.
Thank you!