Latest 1.0.1
Homepage https://github.com/banjun/SwiftBeaker
License MIT
Platforms ios 9.0, osx 10.11
Dependencies APIKit, URITemplate
Authors

Swift client generator for API Blueprint

Input file is an API Blueprint AST file generated by drafter.
Output is a Swift client code (with some dependencies: APIKit, Himotoki, etc)

Examples

see Examples

Real World Examples

banjun/imastodon Mastodon API

Build

debug

% swift build

release (SwiftBeaker/releases)

% swift build -c release -Xswiftc -static-stdlib

Usage

% drafter -f json api-blueprint-document.md > apib.json # generate AST using drafter
% SwiftBeaker apib.json > APIClient.swift

for use in a framework target for the API:

% SwiftBeaker --public apib.json > APIClient.swift # public memberwise init & public members

Conversion

SwiftBeaker converts …

  • each Transitions into a APIKit.Request
  • each Responses bound to a Request into a enum Responses whose cases identified by a pair of status code and content type
  • each Data Structures (named and anonymous) into a Himotoki.Decodable struct

Latest podspec

{
    "name": "SwiftBeaker",
    "version": "1.0.1",
    "summary": "Swift client generator for API Blueprint",
    "description": "SwiftBeaker is a Swift client generator for API Blueprint.nthe pod depends on runtime dependencies that generated client depends on.",
    "homepage": "https://github.com/banjun/SwiftBeaker",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "banjun": "[email protected]"
    },
    "source": {
        "git": "https://github.com/banjun/SwiftBeaker.git",
        "tag": "1.0.1"
    },
    "social_media_url": "https://twitter.com/banjun",
    "platforms": {
        "ios": "9.0",
        "osx": "10.11"
    },
    "source_files": "Pod/Classes/**/*.swift",
    "dependencies": {
        "APIKit": [],
        "URITemplate": []
    },
    "pushed_with_swift_version": "3.1"
}

Pin It on Pinterest

Share This