SeUniVr / RestTestGen

A framework for automated black-box testing of RESTful APIs.
Apache License 2.0
36 stars 9 forks source link

GSON could not parse the response body of this interaction. #12

Closed mo718 closed 1 year ago

mo718 commented 1 year ago

Hello, when I test the project swagger-petstore( https://github.com/swagger-api/swagger-petstore), it reported some warns:

4:47:16.386 [main] DEBUG io.resttestgen.core.helper.RequestManager - Building request for operation GET /user/login
04:47:16.387 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.387 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.387 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.387 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.387 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.387 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.387 [main] DEBUG io.resttestgen.core.Environment - Mutation applied correctly.
04:47:16.388 [main] DEBUG io.resttestgen.core.helper.RequestManager - Building request for operation GET /user/login
04:47:16.389 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.389 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.389 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.389 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.389 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.389 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.389 [main] DEBUG io.resttestgen.core.Environment - Mutation applied correctly.
04:47:16.389 [main] DEBUG io.resttestgen.core.helper.RequestManager - Building request for operation GET /user/login
04:47:16.391 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.391 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.391 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.391 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.391 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.391 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.392 [main] DEBUG io.resttestgen.core.Environment - Mutation applied correctly.
04:47:16.392 [main] DEBUG io.resttestgen.core.helper.RequestManager - Building request for operation GET /user/login
04:47:16.393 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.393 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.393 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.393 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.393 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.393 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.393 [main] DEBUG io.resttestgen.core.Environment - Mutation applied correctly.
04:47:16.393 [main] DEBUG io.resttestgen.core.helper.RequestManager - Building request for operation GET /user/login
04:47:16.394 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.394 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.394 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.394 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.394 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.394 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.395 [main] DEBUG io.resttestgen.core.Environment - Mutation applied correctly.
04:47:16.395 [main] DEBUG io.resttestgen.core.helper.RequestManager - Building request for operation GET /user/login
04:47:16.396 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.396 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.396 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.396 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.396 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.396 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.397 [main] DEBUG io.resttestgen.core.Environment - Mutation applied correctly.
04:47:16.397 [main] DEBUG io.resttestgen.core.helper.RequestManager - Building request for operation GET /user/login
04:47:16.398 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.398 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.398 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.398 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.398 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.398 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.399 [main] DEBUG io.resttestgen.core.Environment - Mutation applied correctly.
04:47:16.399 [main] DEBUG io.resttestgen.core.helper.RequestManager - Building request for operation GET /user/login
04:47:16.400 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.400 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.400 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.400 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.400 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.400 [main] WARN  io.resttestgen.implementation.responseprocessor.JsonParserResponseProcessor - GSON could not parse the response body of this interaction.
04:47:16.400 [main] DEBUG io.resttestgen.core.Environment - Mutation applied correctly.

Could you tell me the reason why Gson cannot parse the response?

davidecorradini commented 1 year ago

Thank you for reporting the issue. There are several potential reasons why GSON may not be able to process the response. Two common scenarios include the response not being in JSON format and the response being excessively long, exceeding our processing limit of 1 million characters. To investigate further and provide a more accurate solution, it would be helpful if you could provide the report file of the interactions. It is available in the output folder of RestTestGen. Thank you.

Best, Davide

davidecorradini commented 1 year ago

Issue closed because of user inactivity, and because the reported issue is likely to be caused by an API returning an incorrect JSON, or data non in JSON format despite setting the Content-Type of the response header to application/json.