- Workspace crates:
sdk(mostly generated from OpenAPI docs usingcodegenwhich is called fromxtask),xtask(automation),codegen(OpenAPI helpers). - Core client logic lives in
sdk/src/lib.rsandsdk/src/client.rs; API groups are insdk/src/resources/*.rs(one snake_case file per OpenAPI tag). openapi.yamldefines the surface area; generated code is committed insdk/src.
cargo check --workspace --all-featuresvalidates all crates quickly.cargo fmt --allapplies the enforced Rustfmt style (CI fails on drift).cargo clippy --workspace --all-targets --all-features -- -D warningskeeps lint debt at zero.cargo test --workspace --all-featuresruns unit, doc, and example tests.cargo run --example checkout_card_readerruns the representative end-to-end example.cargo xtask generategenerates latest SDK from the OpenAPI specs using codegen (CI fails on drift)
- Target Rust 1.82, edition 2021, four-space indents, and no
unsafe. - Lean on existing client helpers for building requests; keep module-level docs current for new endpoints.
cargo fmtandcargo clippyare the single sources of truth for formatting and linting.
- Prefer colocated unit tests with
#[cfg(test)]blocks; add broader coverage undersdk/tests/when needed. - Mock HTTP interactions or serialize payloads to assert shapes - never call live SumUp services.
- Run
cargo test --docwhen updating examples or doctests to keep documentation snippets green. - Aim for each new endpoint or serializer to have at least one round-trip test validating request/response structs.
- Follow Conventional Commits (e.g.,
fix(sdk):,feat(resources):,chore:) as the history demonstrates. - Keep commits focused and rebased; avoid noisy merge commits in PR branches.
- PRs should summarize scope, note breaking changes, list verification commands, and link tracking issues.
- Add screenshots or external references when behavior impacts dashboards or partner integrations.
- Keep generated code up to date, run
cargo xtask generateto refreshsdk/src/resourcesandclient.rs. - Inspect the diff for unintended churn before committing; regenerated files should not be hand-edited.
- Adjust generation behavior through the
codegen/crate when the emitted code needs structural changes.