Minor cleanup
This commit is contained in:
parent
f5ecf2d1b4
commit
7c96301dc0
4 changed files with 17 additions and 15 deletions
20
README.md
20
README.md
|
@ -1,10 +1,16 @@
|
|||
[](https://opensource.org/licenses/BSD-3-Clause) <!-- [](https://github.com/ethauvin/jokeapi/releases/latest) [](https://maven-badges.herokuapp.com/maven-central/net.thauvin.erik/jokeapi) --> [](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/jokeapi/)
|
||||
[](https://opensource.org/licenses/BSD-3-Clause)
|
||||
[](https://kotlinlang.org/)
|
||||
[](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/jokeapi/)
|
||||
[](https://github.com/ethauvin/jokeapi/releases/latest)
|
||||
[](https://maven-badges.herokuapp.com/maven-central/net.thauvin.erik/jokeapi)
|
||||
|
||||
[](https://sonarcloud.io/dashboard?id=ethauvin_jokeapi) [](https://github.com/ethauvin/jokeapi/actions/workflows/gradle.yml) [](https://circleci.com/gh/ethauvin/jokeapi/tree/master)
|
||||
[](https://sonarcloud.io/dashboard?id=ethauvin_jokeapi)
|
||||
[](https://github.com/ethauvin/jokeapi/actions/workflows/gradle.yml)
|
||||
[](https://circleci.com/gh/ethauvin/jokeapi/tree/master)
|
||||
|
||||
# JokeAPI for Kotlin/Java
|
||||
# JokeAPI for Kotlin, Java and Android
|
||||
|
||||
A simple Kotlin/Java library to retrieve jokes from [Sv443's JokeAPI](https://v2.jokeapi.dev/).
|
||||
A simple library to retrieve jokes from [Sv443's JokeAPI](https://v2.jokeapi.dev/).
|
||||
|
||||
## Examples (TL;DR)
|
||||
|
||||
|
@ -17,7 +23,7 @@ val pun = getJoke(categories = setOf(Category.PUN))
|
|||
```
|
||||
The parameters match the [joke endpoint](https://v2.jokeapi.dev/#joke-endpoint).
|
||||
|
||||
A `Joke` class instance is returned:
|
||||
A `Joke` class instance is returned, matching the [response](https://v2.jokeapi.dev/joke/Any?type=single):
|
||||
|
||||
```kotlin
|
||||
data class Joke(
|
||||
|
@ -45,7 +51,7 @@ frenchJokes.forEach {
|
|||
- View more [examples](https://github.com/ethauvin/jokeapi/blob/master/src/test/kotlin/net/thauvin/erik/jokeapi/GetJokesTest.kt)...
|
||||
|
||||
|
||||
If an error occurs, a `JokeException` is thrown:
|
||||
If an error occurs, a `JokeException` is thrown, matching the [JokeAPI errors](https://sv443.net/jokeapi/v2/#errors):
|
||||
|
||||
```kotlin
|
||||
class JokeException(
|
||||
|
@ -88,7 +94,7 @@ To use with [Gradle](https://gradle.org/), include the following dependency in y
|
|||
```gradle
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
|
||||
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") } // only needed for SNAPSHOT
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue