Started README
This commit is contained in:
parent
733c76f447
commit
5ac9e751c3
2 changed files with 34 additions and 0 deletions
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
28
README.md
Normal file
28
README.md
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# JokeAPI for Kotlin/Java
|
||||||
|
|
||||||
|
A simple Kotlin/Java library to retrieve jokes from [Sv443's JokeAPI](https://v2.jokeapi.dev/).
|
||||||
|
|
||||||
|
## Examples (TL;DR)
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
import net.thauvin.erik.jokeapi.JokeApi.Companion.getJoke
|
||||||
|
|
||||||
|
val joke = getJoke()
|
||||||
|
val safe = getJoke(safe = true)
|
||||||
|
val pun = getJoke(category = Category.PUN)
|
||||||
|
```
|
||||||
|
|
||||||
|
A `Joke` class instance is returned:
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
data class Joke(
|
||||||
|
val error: Boolean,
|
||||||
|
val category: Category,
|
||||||
|
val type: Type,
|
||||||
|
val joke: Set<String>,
|
||||||
|
val flags: Set<Flag>,
|
||||||
|
val id: Int,
|
||||||
|
val safe: Boolean,
|
||||||
|
val language: Language
|
||||||
|
)
|
||||||
|
```
|
Loading…
Add table
Add a link
Reference in a new issue