This was created by Swagger with this command line:
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \
generate -i https://developer.wordnik.com/api-docs/swagger.json \
--api-package edu.mills.cs180a.wordnik.client.api \
--model-package edu.mills.cs180a.wordnik.client.model \
--invoker-package edu.mills.cs180a.wordnik.client.invoker \
--group-id cs180a --artifact-id wordnik-api-client \
--artifact-version 0.0.1-SNAPSHOT \
-l java --library feign -o wordnik-api-clientI then modified pom.xml to:
- change the default name
- add a dependency on
javax.annotations - generate a jar file with dependencies
I also changed LocalDate to OffsetDateTime in the model using this command line:
sed -i 's/LocalDate/OffsetDateTime/g' model/*.javaThe rest of this file was automatically generated by Swagger.
Building the API client library requires Maven to be installed.
To install the API client library to your local Maven repository, simply execute:
mvn installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn deployRefer to the official documentation for more information.
After the client library is installed/deployed, you can use it in your Maven project by adding the following to your pom.xml:
<dependency>
<groupId>cs180a</groupId>
<artifactId>wordnik-api-client</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.