You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project I use swagger-codegen-maven-plugin 2.4.9 + rest assured 4.1.1 and gson library for serialization. When I added the swagger-coverage in the pom.xml, jackson library was included into the classpath too. When i started to build my project the class model was generated using gson library.
The following error occurred while running the tests:
[ERROR] checkDeposit(com.test.SimpleTest) Time elapsed: 1.859 s <<< ERROR!
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:
Unrecognized field "Result" (class com.test.model.ApiResultIResponseAuth), not marked as ignorable (2 known properties: "error", "result"])
at [Source: (String)"{"Result":{"AccessToken":"token","Expires"[truncated 296 chars]; line: 1, column: 12] (through reference chain: com.test.model.ApiResultIResponseAuth["Result"])
Workaround:
One of simple workarounds is maven exclusions.
You may just exclude jackson library from classpath for swagger-coverage-rest-assured:
In my project I use swagger-codegen-maven-plugin 2.4.9 + rest assured 4.1.1 and gson library for serialization. When I added the swagger-coverage in the pom.xml, jackson library was included into the classpath too. When i started to build my project the class model was generated using gson library.
The following error occurred while running the tests:
Workaround:
One of simple workarounds is maven exclusions.
You may just exclude jackson library from classpath for swagger-coverage-rest-assured:
Or you may configure RestAssured to use GSON serialization library directly.
This can be done using
ObjectMapperConfig.java
https://github.com/rest-assured/rest-assured/blob/master/rest-assured/src/main/java/io/restassured/config/ObjectMapperConfig.java
The text was updated successfully, but these errors were encountered: