Centralized OpenAPI specification and client generation for the Floatplane API.
This package houses the Floatplane API OpenAPI specification and provides scripts to generate type-safe API clients for iOS (Swift) and Android (Kotlin).
File: floatplane-openapi-specification.json
Origin: Community-maintained FloatplaneAPI
Version: 3.10.0-c
The spec is version-controlled in this repository to ensure build reproducibility. It can be updated manually using:
pnpm openapi:update-specGenerates Swift 5 models with async/await support for the iOS app.
pnpm openapi:generate:swiftOutput: apps/ios/FloatNative/Models/Generated/
Features:
- Selective model copying (only includes models actually used by the app)
- Automatic dependency resolution
- Post-processing fixes for known generator bugs
- Preserves custom helper files (
JSONEncodable.swift,ArrayRule.swift)
pnpm openapi:generate:kotlinStatus: Not yet implemented (placeholder script)
While most models are auto-generated, the iOS app maintains custom wrappers and extensions in apps/ios/FloatNative/Models/ for:
BlogPostDetailedWithInteraction: Adds missingselfUserInteractionfield not in OpenAPI specWatchHistoryBlogPost: Different response format for watch history endpoint
- Type aliases:
BlogPost,Creator,DeliveryInfo, etc. (shorthand for verbose generated names) - Extensions: Helper methods on generated models (
ImageModel.fullURL,DeliveryInfo.bestThumbnail)
CompanionModels.swift: Models for the proprietary Companion API (Watch Later, Playlists, Enhanced Search)- Not part of official Floatplane API, so not in OpenAPI spec
-
Missing field:
selfUserInteractioninContentPostV3Response- Impact: Shows which reaction (like/dislike) the user made on a post
- Workaround:
BlogPostDetailedWithInteractionwrapper - Status: Could be contributed back to community spec
-
Generator bug: Invalid
Identifiableconformance on union types- Impact:
BlogPostModelV3Channelfails to compile - Workaround: Post-processing script removes invalid conformance
- Impact:
-
Download latest spec:
pnpm openapi:update-spec
-
Test generation:
pnpm openapi:generate:swift
-
Verify in Xcode that generated models compile and work correctly
-
Commit both the spec and newly generated models
If you discover missing fields or API inconsistencies:
- Document the finding with network inspector proof
- Open an issue on FloatplaneAPI
- Submit a PR with the spec change
- Update your local spec once merged
This helps the entire Floatplane development community!