CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

SwiftBeaker 1.0.1

SwiftBeaker 1.0.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jan 2018
SwiftSwift Version 3.1
SPMSupports SPM

Maintained by BAN Jun.



 
Depends on:
APIKit>= 0
URITemplate>= 0
 

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

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