oanda-v20-openapi

Crates.iooanda-v20-openapi
lib.rsoanda-v20-openapi
version0.2.1
created_at2025-09-06 12:43:35.504604+00
updated_at2025-09-08 13:01:53.522522+00
descriptionThe full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
homepage
repository
max_upload_size
id1827031
size1,112,706
Jacob (jxcv0)

documentation

README

OANDA v20 – Autogenerated Rust Client

Status: pre-alpha. Autogenerated. Lightly hand-patched. Expect breaking changes.

This crate is an autogenerated Rust client for the OANDA v20 REST API. It is not well-tested and is under active development. The upstream OpenAPI/Swagger spec appears abandoned, so this repository includes a maintained copy of the v20 spec with updates.

I am not affiliated with OANDA. Use at your own risk.

What you get

Autogenerated request/response types and API methods from an OpenAPI spec.

Minimal ergonomics added only where necessary to get things compiling.

No stability guarantees yet (SemVer 0.x; breaking changes may happen at any time).

Why a self maintained spec?

The public v20 spec is invalid and out of date.

If you spot mismatches with the API spec in the repository or want to suggest an improvement, please open an issue with the exact endpoint and a redacted sample payload.

Current caveats

Hardly any test coverage. Basic unit tests exist for bugs I have found while using this crate in my own projects. Zero integration tests with the actual API for now.

Generated code first. The only manual code in this crate is to test the generated code.

Regenerating the client

This project is generated from the local spec (patched). Typical flow:

Edit the spec v20-openapi.yaml and keep patches minimal and documented.

Run the generation script gen.sh to rewrite the client code.

Build and run tests with cargo test.

Testing

To avoid editing generated code, unit tests live under tests/.

Versioning

Until 1.0, any release may contain breaking changes.

Release notes on GitHub will note the changes.

Contributing

Issues and PRs are welcome, especially reports of spec/response mismatches with small, reproducible samples. Please keep changes narrowly scoped (one endpoint or one model at a time).

While working on this API spec I am also trying to wrap it in a more idiomatic and testable oanda-v20-rs crate.

Disclaimer

This project is unofficial and not endorsed by OANDA.

No warranties of any kind. The API and/or this client may change without notice.

Foreign exchange and CFD trading involve significant risk of loss. Nothing here is financial advice.

Commit count: 0

cargo fmt