APIKit is a Swift library to give you more flexibility when developing web APIs. In its current version APIKit is a POC for a framework that provides a declarative, composeable DSL which makes developing APIs against a communication protocol (CCP) natural interface a breeze. APIKit handles the mapping to concrete CCPs with no hassle.
Below is an example of an API that manages Vehicles and Customers beloging to a car vendor.
struct CarVendorAPI: API {
var content: APILogic {
Version("v1") {
CRUD<Car>()
Group {
ReadOne<Customer>()
Update<Customer>()
}.RESTGroup("customer")
CRUD<Customer>()
}
}
}
You can install APIKit via Swift Package Manager by adding the following line to your Package.swift
:
import PackageDescription
let package = Package(
[...]
dependencies: [
.Package(url: "https://github.com/Apodini/APIKit.git", majorVersion: XYZ)
]
)
Contributions to this projects are welcome. Please make sure to read the contribution guidelines first.
APIKit is licensed under the MIT License. See LICENSE file for more information.