{"id":40855149,"url":"https://github.com/offscale/cdd-rust","last_synced_at":"2026-06-07T03:01:39.362Z","repository":{"id":93965940,"uuid":"173644583","full_name":"offscale/cdd-rust","owner":"offscale","description":"OpenAPI ↔ Rust (actix, diesel)","archived":false,"fork":false,"pushed_at":"2026-03-20T08:40:47.000Z","size":1100,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-03-20T19:47:25.215Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/offscale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-03-03T23:55:05.000Z","updated_at":"2026-03-20T08:40:51.000Z","dependencies_parsed_at":"2025-09-21T05:38:16.969Z","dependency_job_id":null,"html_url":"https://github.com/offscale/cdd-rust","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/offscale/cdd-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offscale%2Fcdd-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offscale%2Fcdd-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offscale%2Fcdd-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offscale%2Fcdd-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/offscale","download_url":"https://codeload.github.com/offscale/cdd-rust/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offscale%2Fcdd-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31922399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-21T23:44:59.972Z","updated_at":"2026-05-22T23:04:34.013Z","avatar_url":"https://github.com/offscale.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"cdd-rust\n========\n[![License](https://img.shields.io/badge/license-Apache--2.0%20OR%20MIT-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![interactive WASM web demo](https://img.shields.io/badge/interactive-WASM_web_demo-blue.svg)](https://offscale.io/wasm_web_demo)\n[![CI](https://github.com/offscale/cdd-rust/actions/workflows/ci.yml/badge.svg)](https://github.com/offscale/cdd-rust/actions)\n[![Test Coverage](https://img.shields.io/badge/test_coverage-100.00%25-brightgreen.svg)](#)\n[![Doc Coverage](https://img.shields.io/badge/doc_coverage-100.00%25-brightgreen.svg)](#)\n\n----\n\nOpenAPI ↔ Rust. This is one compiler in a suite, all focussed on the same task: Compiler Driven Development (CDD).\n\nEach compiler is written in its target language, is whitespace and comment sensitive, and has both an SDK and CLI.\n\nThe core philosophy of Compiler Driven Development (CDD) is synchronization without compromise. Where traditional generators silo your API boundaries into read-only files, this compiler natively merges changes into your codebase via a robust, [whitespace and comment aware] Abstract Syntax Tree (AST) driven parser \u0026 emitter. It bridges the gap between design and implementation, allowing you to seamlessly generate SDKs from a spec or extract a spec from existing code. By keeping your APIs, SDKs, and tests in continuous, automated alignment, it drastically improves both delivery speed and software reliability.\n\nThe CLI—at a minimum—has:\n\n- `cdd-rust --help`\n- `cdd-rust --version`\n- `cdd-rust from_openapi to_sdk_cli -i spec.json`\n- `cdd-rust from_openapi to_sdk -i spec.json`\n- `cdd-rust from_openapi to_server -i spec.json`\n- `cdd-rust to_openapi -f path/to/code`\n- `cdd-rust to_docs_json --no-imports --no-wrapping -i spec.json`\n- `cdd-rust serve_json_rpc --port 8080 --listen 0.0.0.0`\n\n## SDK Example\n\n```rs\nuse cdd_core::openapi::parse::parse_openapi_spec;\nuse cdd_core::classes::emit::generate_dtos;\nuse std::fs;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let spec = fs::read_to_string(\"spec.yaml\")?;\n    let models = parse_openapi_spec(\u0026spec)?;\n    \n    // Generate idiomatic Rust structs from the OpenAPI Components/Schemas\n    let rust_code = generate_dtos(\u0026models);\n    \n    fs::write(\"models.rs\", rust_code)?;\n    Ok(())\n}\n```\n\n## Installation\n\n```bash\ncargo build\n```\n\n## Development\n\nYou can use standard Cargo commands or the included cross-platform Makefiles to fetch dependencies, build, and test:\n\n```bash\ncargo clippy\ncargo test\n# or\nmake deps\nmake build\nmake test\n# or on Windows\n.\\make.bat deps\n.\\make.bat build\n.\\make.bat test\n```\n\nSee [PUBLISH.md](PUBLISH.md) for packaging and releasing.\n\n## Features\n\nThe `cdd-rust` compiler leverages a unified architecture to support various facets of API and code lifecycle management. For a deep dive into the compiler's design, see [ARCHITECTURE.md](ARCHITECTURE.md).\n\n- **Compilation**:\n    - **OpenAPI → `Rust`**: Generate idiomatic native models, network routes, client SDKs, and boilerplate directly from OpenAPI (`.json` / `.yaml`) specifications.\n    - **`Rust` → OpenAPI**: Statically parse existing `Rust` source code and emit compliant OpenAPI specifications.\n- **AST-Driven \u0026 Safe**: Employs static analysis instead of unsafe dynamic execution or reflection, allowing it to safely parse and emit code even for incomplete or un-compilable project states.\n- **Seamless Sync**: Keep your docs, tests, database, clients, and routing in perfect harmony. Update your code, and generate the docs; or update the docs, and generate the code.\n\n**Uncommon Features:**\n\n`cdd-rust` supports extensive backwards compatibility features:\n- **Legacy Swagger 2.0 Support:** Natively parses and processes legacy `swagger: \"2.0\"` specifications in addition to OpenAPI 3.x, ensuring seamless backwards compatibility and bridging older APIs into the modern Rust ecosystem.\n\n## CLI Options\n\n```text\nCDD Toolchain CLI\n\nUsage: cdd-rust [OPTIONS] \u003cCOMMAND\u003e\n\nCommands:\n  sync            Synchronize DB schema to Rust models and OpenAPI-ready structs\n  test-gen        Generates integration tests based on OpenAPI contracts\n  scaffold        Scaffolds handler functions from OpenAPI Routes\n  schema-gen      Generates a JSON Schema from a Rust struct or enum\n  to_docs_json    Generates a JSON output with documentation code snippets for an OpenAPI spec\n  from_openapi    Generates code from an OpenAPI specification\n  to_openapi      Generates an OpenAPI specification from source code\n  serve_json_rpc  Expose CLI interface as JSON-RPC server over HTTP\n  help            Print this message or the help of the given subcommand(s)\n\nOptions:\n  -t, --target \u003cTARGET\u003e\n          Target mode (server or client)\n\n          Possible values:\n          - server-actix: Generate Actix Web server scaffolding\n          - server-axum:  Generate Axum server scaffolding\n          - client:       Generate Reqwest client scaffolding\n          - cli:          Generate Clap CLI scaffolding\n          \n          [env: CDD_TARGET=]\n          [default: server-actix]\n\n  -h, --help\n          Print help (see a summary with '-h')\n\n  -V, --version\n          Print version\n```\n\n---\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttps://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffscale%2Fcdd-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffscale%2Fcdd-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffscale%2Fcdd-rust/lists"}