mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
It called itself a landing page pointing elsewhere while Sources/Hanzo holds the generated client. The quickstart now names HanzoAPIConfiguration and getModels as they are declared, and says plainly that getModels returns nothing to decode. scripts/generate.sh is the call site every other SDK has: it names swift and this checkout, and nothing about how.
24 lines
979 B
Bash
Executable File
24 lines
979 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# The call site. Nothing about HOW this SDK is generated lives here.
|
|
#
|
|
# The invocation is logic and lives once, in hanzoai/openapi's `generate.py`;
|
|
# every per-language knob is data in `sdks.yaml` beside it. This file says
|
|
# "swift, into this checkout" and nothing else.
|
|
#
|
|
# ./scripts/generate.sh # regenerate Sources/Hanzo + Package.swift
|
|
# ./scripts/generate.sh --check # fail if the committed tree has drifted
|
|
#
|
|
# BOTH INPUTS ARRIVE AS VALUES. $SPEC is the document, already fetched at a
|
|
# pinned ref and digest-checked; $OPENAPI is the checkout holding the driver.
|
|
# hanzoai/ci's client lane sets both.
|
|
#
|
|
# Requires: java 17+, uv.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
: "${OPENAPI:?the generator lives in hanzoai/openapi; the ci client lane sets OPENAPI, or point it at a checkout}"
|
|
|
|
if [ -n "${SPEC:-}" ]; then set -- --spec "$SPEC" "$@"; fi
|
|
|
|
exec uv run --with pyyaml python3 "$OPENAPI/generate.py" swift --repo "$PWD" "$@"
|