Skip to content

Latest commit

 

History

History
55 lines (43 loc) · 2.51 KB

File metadata and controls

55 lines (43 loc) · 2.51 KB

Contributing

Thanks for your interest in contributing! This project has an unusual shape: almost all Swift code under Sources/ is generated, and the real source of truth is the build pipeline. Please read this before opening a PR.

What you can (and can't) edit

Path Edit by hand?
Sources/*/Client.swift, Sources/*/Types.swift ❌ Generated by swift-openapi-generator. Changes will be overwritten.
Package.swift ❌ Generated by Scripts/PackageBuilder.swift.
.spi.yml ❌ Generated by Scripts/SPIManifestBuilder.swift.
Scripts/*.swift, Makefile ✅ This is the actual source code.
.github/** ✅ CI workflows and composite actions.
Sources/issues/Documentation.docc/** ✅ DocC tutorial content.
Tests/**, README.md, other docs

How the pipeline works

  1. The git submodule tracks github/rest-api-description.
  2. Scripts/PackageTargetsParser.swift reads the OpenAPI document's tags — each tag becomes one module (e.g. reposGitHubRestAPIRepos).
  3. make generates per-tag generator configs, runs swift-openapi-generator, then regenerates Package.swift and .spi.yml.
  4. Dependabot bumps the submodule weekly; CI regenerates and auto-merges.

Local development

git clone --recurse-submodules https://github.com/Wei18/github-rest-api-swift-openapi.git
cd github-rest-api-swift-openapi
make            # regenerate everything (clones and builds the generator on first run)
swift test      # run the test suite

Each regenerated artifact is committed separately by make commit with the message Commit via running: make <file> — please keep that convention.

Reporting issues

Pull requests

  • Keep changes minimal and focused; one concern per PR.
  • Don't include regenerated Sources/** churn in hand-written changes — CI regenerates sources on submodule updates.
  • Make sure swift build passes for any target you touch.