Three ways in
Fetch a live URL, paste JSON or YAML, or drop a spec file. Localhost and private specs are supported.
- URL, paste, and file drop
- Private specs with auth
Native macOS · v1.0
SpecForge converts OpenAPI 3 and Swagger 2 documents into a ready-to-build Swift package — Codable models, typed endpoints, and an async URLSession client. No boilerplate. No web wrapper.
Free · Universal binary · macOS 14+ · Specs stay on your Mac
Why SpecForge
Stop hand-writing models from JSON examples. Bring the spec, choose a few options, and get a package that compiles.
Fetch a live URL, paste JSON or YAML, or drop a spec file. Localhost and private specs are supported.
Bearer tokens, API keys, and HTTP Basic auth for protected specifications. Credentials never enter the generated code.
Nested objects, enums, nullability, maps, unions, allOf inheritance, and recursive types become compilable Swift.
One typed async method per operation, with path, query, and header parameters plus JSON request bodies.
Export a complete Swift package with a manifest, sources, and a README. Or choose flat files for an existing target.
A native, on-device workflow. No telemetry, no uploaded specs, and no secrets embedded in client code.
How it works
The app handles the tedious parts: parsing, naming, type mapping, request building, and file assembly.
Use an OpenAPI 3.0/3.1 or Swagger 2.0 document. Fetch it from a URL, paste it, or drop a JSON/YAML file.
Choose access level, date mapping, a type prefix, and an optional base URL override. Sensible defaults are already set.
Review every file in the app, then export a Swift package that opens directly in Xcode and builds with SwiftPM.
The output
SpecForge keeps the client small, readable, and dependency-free. Just Foundation, URLSession, and standard Swift concurrency.
public enum TaskStatus: String, Codable, CaseIterable {
case backlog = "backlog"
case inProgress = "in_progress"
case inReview = "in_review"
case done = "done"
}
public struct Task: Codable {
public var id: String
public var title: String
public var status: TaskStatus
public var priority: Priority
public var dueDate: Date?
public var labels: [String]?
public var assignee: User?
public var metadata: [String: String]?
}
public final class APIClient: @unchecked Sendable {
public static let shared = APIClient()
public var auth: APIAuth?
public func send<T: Decodable>(
path: String,
method: HTTPMethod,
queryItems: [URLQueryItem] = [],
headers: [String: String] = [:],
responseType: T.Type
) async throws -> T {
let data = try await execute(
path: path,
method: method,
queryItems: queryItems,
headers: headers,
bodyData: nil
)
return try decode(data, as: responseType)
}
}
public func listTasks(
workspaceID: String,
status: TaskStatus? = nil,
assigneeID: String? = nil,
limit: Int? = nil,
cursor: String? = nil
) async throws -> TaskPage {
let path = "/workspaces/\(workspaceID)/tasks"
var queryItems: [URLQueryItem] = []
if let status {
queryItems.append(.init(name: "status", value: status.rawValue))
}
if let limit {
queryItems.append(.init(name: "limit", value: String(limit)))
}
return try await send(
path: path,
method: .get,
queryItems: queryItems,
responseType: TaskPage.self
)
}
A native workflow
SpecForge is a real SwiftUI application with drag and drop, keyboard shortcuts, native panels, and a code viewer. It feels at home next to Xcode.
Compatibility
SpecForge handles the common production contracts. When it can’t map something safely, it tells you in the Notices panel instead of silently dropping it.
FAQ
Yes. It’s built with SwiftUI and runs entirely on your Mac. There is no web view, local server, or account layer in the app.
They are attached only to the outgoing request that downloads the specification. Tokens and passwords are never embedded in generated files, logged, or sent anywhere else.
The generated package uses Swift 5.9+ and targets iOS 15, macOS 12, tvOS 15, and watchOS 8 or later. The macOS app itself requires macOS 14+.
Yes. Export a package and add it as a local dependency, or turn off “Swift Package” during generation to get flat Swift files you can drag into a target.
Yes. Choose Bearer, API key, or Basic authentication before fetching. The URL flow supports protected endpoints and localhost.
The app is free to download. The source is available on GitHub so you can inspect the generator and build it yourself.
Open the DMG, drag SpecForge to Applications, and launch it. The build is ad-hoc signed but not notarized, so macOS blocks the first launch. On macOS 15 or later, open System Settings → Privacy & Security, scroll down, and click Open Anyway. On macOS 14, right-click the app and choose Open. You only need to do this once.
Ready when your spec is
Download SpecForge, drop in a spec, and have a Swift package in under a minute.
macOS 14+ · Universal (Apple Silicon & Intel) · No account required
First launch: System Settings → Privacy & Security → Open Anyway