(poc): Experimenting with Swagger API generator

Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
This commit is contained in:
Patrik Gfeller 2024-12-08 18:04:04 +01:00
parent a35fb50e00
commit 9308073c20
No known key found for this signature in database
GPG Key ID: 5EBA8954A87B9AEF
5 changed files with 117444 additions and 0 deletions

View File

@ -0,0 +1,4 @@
{
"groupId": "org.openhab.binding.jellyfin.internal.API.generated"
}

View File

@ -0,0 +1,39 @@
#!/usr/bin/bash
clear
CLI=2.2.1
VERSION=$(curl -sL https://repo.jellyfin.org/releases/openapi/jellyfin-openapi-stable.json | jq -r .info.version)
echo " - Using latest Jellyfin API: ${VERSION}"
FILENAME="./jellyfin-openapi-$VERSION.json"
if [ ! -e "${FILENAME}" ]; then
echo "⏬ - Downloading latest OPENAPI definition for Version ${VERSION}..."
wget \
--no-verbose \
--output-document=$FILENAME \
https://repo.jellyfin.org/releases/openapi/jellyfin-openapi-stable.json
fi
# http://nuc.ehrendingen:8096/api-docs/openapi.json
# OPENAPI=openapi-jellyfin-10.10.3.json
# library
# library template (sub-template) to use:
# jersey1 - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2
# jersey2 - HTTP client: Jersey client 2.6
# feign - HTTP client: Netflix Feign 8.1.1. JSON processing: Jackson 2.6.3
# okhttp-gson (default) - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1
# retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0)
# retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2)
# google-api-client - HTTP client: google-api-client 1.23.0. JSON processing: Jackson 2.8.9
# rest-assured - HTTP client: rest-assured : 3.1.0. JSON processing: Gson 2.6.1. Only for Java8
# java -Xmx8G -jar swagger-codegen-cli-${CLI}.jar generate \
# -i $OPENAPI
# -l java
# -c config.json
# -o ~Temp/jellyfin/api/$VERSION

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff