Taking Github's OpenAPI.yaml file and pairing it with swift-openapi-generator
This uses Github OpenAPI OpenAPI yaml as source input. Specificaly this file.
This branch builds sources through the generator plugin.
The following was done to make it build:
- All yaml
paths:
operations were removed. webhooks:
was renamed topaths:
- All
externalDocs:
were removed
When using JSONDecoder
to decode the types, you'll want to use .iso8601
date decoding.
import Push
func foo(data: Data) throws {
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .iso8601
let data = pushEventString.data(using: .utf8)!
let decoded = try decoder.decode(Push.Components.Schemas.WebhookPush.self, from: data)
print(decoded)
}