This commit is contained in:
Ethan Pippin 2023-11-02 11:57:32 -06:00 committed by GitHub
parent 7dbcd9dc46
commit d19dc290df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 10 deletions

13
Makefile Normal file
View File

@ -0,0 +1,13 @@
# Download latest spec and run CreateAPI
.PHONY: update
update: download generate
# Download the latest Jellyfin spec
.PHONY: download
download:
curl -fsSl https://api.jellyfin.org/openapi/jellyfin-openapi-stable.json -o Sources/jellyfin-openapi-stable.json
# Run CreateAPI
.PHONY: generate
generate:
swift package --allow-writing-to-package-directory generate-api

View File

@ -24,17 +24,9 @@ Alternatively, you can use your own network stack with the generated **Entities*
## Generation
The mechanism for generating **Entities**, **Extensions**, and **Paths** with CreateAPI is provided as an Xcode command plugin.
1. Download [the latest Jellyfin schema](https://api.jellyfin.org/openapi/jellyfin-openapi-stable.json)
2. Move the schema to **Sources**
3. Delete the current **Entities**, **Extensions**, and **Paths** directories
4. Run the following command in the package directory:
```bash
# runs the CreateAPI Xcode command plugin
$ swift package --allow-writing-to-package-directory generate-api
# Download latest spec and run CreateAPI
$ make update
```
5. New **Entities**, **Extensions**, and **Paths** directories should be available within the package
Alternatively, you can generate your own Swift Jellyfin SDK using [CreateAPI](https://github.com/CreateAPI/CreateAPI) or any other OpenAPI generator.