bilaalrashid / bbc-news-swift

A Swift client for the BBC News API.
https://bilaalrashid.github.io/bbc-news-swift/
MIT License
1 stars 0 forks source link

Use openapi code generator #11

Open bilaalrashid opened 4 months ago

bilaalrashid commented 4 months ago

Currently, we manually maintain separate definitions of the API in both OpenAPI and Swift. Ideally, we would want to merge these, forming a single source of truth that will reduce maintenance overheads.

There would be two options: generating the OpenAPI spec from Swift or generating the Swift code from OpenAPI. Ideally, we would want to generate the Swift from the OpenAPI spec as this would then allow us to easily support other languages.

This biggest blocker here would be the quality of https://github.com/apple/swift-openapi-generator. This is a very complex OpenAPI spec and it is unlikely that codegen would produce a nice interface without additional upstream merges.

dsinghvi commented 2 months ago

Hey @bilaalrashid -- You now have a third option, Fern! We build and maintain code generators that output idiomatic SDKs.

Our swift generator is currently in beta. Would you like to see a demo of what your SDK would like?