OpenAPI ↔ Rust. Compiler Driven Development (CDD) is a new development methodology, with implementations in many languages.
The central idea is to statically code-generate from target language to OpenAPI, and from OpenAPI back to target language.
All without having an untouchable 'generated' directory and without requiring #[openapi]
annotations on struct
s and routes.
Key other advantages are:
- automated updating of tests and docs, making it feasible to maintain 100% coverage without trading off development agility;
- synchronisation across language boundaries (e.g., between the frontends, and from them to the backend).
Longer-term there are many other advantages, including:
- inversion of control, enabling the business analyst to design schemas (Google Forms or even MS Access style);
- simplifying separating projects out into multiple smaller projects, and smaller projects into a big project;
- providing an alternative to NoSQL for many user-defined schema scenarios (such as a survey-builder site).
Install the latest version of Rust. We tend to use nightly versions. CLI tool for installing Rust.
We use rust-clippy linters to improve code quality.
There are plenty of IDEs and other Rust development tools to consider.
# Install Rust (nightly)
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly
# Install cargo-make (cross-platform feature-rich reimplementation of Make)
$ cargo install --force cargo-make
# Install rustfmt (Rust formatter)
$ rustup component add rustfmt
# Clone this repo
$ git clone https://github.com/offscale/cdd-rust && cd cdd-rust
# Run tests
$ cargo test
# Format, build and test
$ cargo make
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.