Reputation: 11
Could you please explain why unirest cannot recognise gson mapper dependency in pom.xml?
As a result, I cannot use method asJson()
as it throws exception:
Caused by: kong.unirest.UnirestConfigException: No Json Parsing Implementation Provided Please add a dependency for a Unirest JSON Engine. This can be one of: com.konghq unirest-object-mappers-gson
${latest-version}
The pom.xml looks as follows:
<dependencies>
<dependency>
<groupId>com.konghq</groupId>
<artifactId>unirest-java</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>com.konghq</groupId>
<artifactId>unirest-object-mappers-gson</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>LATEST</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.1</version>
</dependency>
</dependencies>
Upvotes: 1
Views: 640
Reputation: 21
It looks like there is a bug in the latest version of the library (unirest-java 4.0.0-RC2). Using unirest-java 4.0.0-RC1 fixed this issue for me.
Upvotes: 2