Build the sample with swift build
.
To run it, create a new API token in the Span dashboard and run
swift run span-sample --api-token=[API token]
Rather than using a prebuilt client the OpenAPI generator is a plugin in the project as described in this tutorial from Apple.
You'll have to add the openapi.yaml file from the service but it's relatively easy to update the yaml file as part of your build process.
The two YAML files in the Sources is used by the OpenAPI generator plugin to
build the client. The Packages.swift
file contains the required dependencies.
The OpenAPI spec is available in several other repositories; you can download it with wget
before building. This
will download the latest version of the specification:
cd Sources
rm -f openapi.yaml
wget https://raw.githubusercontent.com/lab5e/go-spanapi/main/api/openapi.yaml