RESTest icon indicating copy to clipboard operation
RESTest copied to clipboard

sub-property error

Open sooding93 opened this issue 4 years ago • 3 comments

Hi, thank you for this amazing tool!

I found an error with finding sub-property.

In the CoverageGatherer.addResponseBodyPropertiesCriterion method, it tries to recursively find sub-properties.

However, if A definition has a $ref value of B definition and B definition has a $ref value of A definition, RESTest traverse A and B until it gets stack limit error.

For example, in the EvoMaster's benchmark repo, they have scout-api project which has "user" definition and "user identity" definition. They refer each other, so RESTest gets an stack limit error.

sooding93 avatar Apr 01 '21 20:04 sooding93

Hi @sooding93

Thanks a lot for your interest in RESTest.

Indeed, we've been having troubles with the Coverage module for some time, due to that kind of issues. If you disabled the Coverage feature of RESTest, then you wouldn't have any problems. But I don't think there's a way to completely disable it as of now. We'll create a fix, either to disable the coverage or to handle those scenarios (cyclic objects). I'm aware of how it's done in EvoMaster, so it shouldn't be too hard.

AML14 avatar Apr 03 '21 09:04 AML14

Could I just delete CoverageGatherer.java file's this part for now? (line 375 ~377)

for (Entry<String, Schema> openApiProperty: openApiProperties.entrySet()) { // Recursively add criteria for each property addResponseBodyPropertiesCriterion(openApiProperty.getValue(), criteria, baseRootPath+openApiProperty.getKey()); // update rootPath with the name of the property }

After I comment it, I don't have errors any more.

sooding93 avatar Apr 06 '21 06:04 sooding93

Yes, that should probably work. Basically you're telling RESTest not to collect coverage information for some nested response body properties, but the testing functionality will be exactly the same.

AML14 avatar Apr 06 '21 10:04 AML14