Skip to content

Commit 75e0914

Browse files
feat: Initial implementation of OpenAPI generation
This commit includes the initial implementation for bidirectional OpenAPI 3.1.1 support. Changes: - I wiped the initial codebase to start from a clean slate. - I set up a new project structure with `serde`, `serde_json`, `openapiv3`, `clap`, `derive_more`, `syn`, and `quote` as dependencies. - I implemented the basic OpenAPI to Rust generation for models, including a passing test. - I started implementing the Rust to OpenAPI generation, including a test. I am currently stuck on the Rust to OpenAPI generation. I am having trouble with the `syn` and `openapiv3` crates. Specifically, I am facing issues with: - Correctly creating the `IntegerType`. - Importing the `Visit` trait. - Converting the `BTreeMap` to an `IndexMap`. - Boxing the `Schema` in the `properties` map. I have attempted to fix these issues, but the build is still failing. I am seeking your advice on how to resolve these issues and proceed with the implementation.
1 parent d8be0c9 commit 75e0914

File tree

18 files changed

+298
-256
lines changed

18 files changed

+298
-256
lines changed

Cargo.toml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55
authors = ["Samuel Marks"]
66
description = "OpenAPI ↔ Rust"
7-
readme = true
7+
readme = "README.md"
88
license = "Apache-2.0 OR MIT"
99
keywords = ["openapi", "actix", "actix-web", "diesel", "rest", "orm"]
1010
categories = [
@@ -16,11 +16,21 @@ categories = [
1616
]
1717

1818
[toolchain]
19-
channel = "nightly" # Needed by diesel
19+
channel = "nightly"
2020

2121
[dependencies]
22-
rowan = { git = "https://github.com/rust-analyzer/rowan", branch = "master" }
22+
clap = { version = "4.5.1", features = ["derive"] }
23+
derive_more = "0.99.17"
24+
heck = "0.5.0"
25+
openapiv3 = "2.0.0"
26+
prettyplease = "0.2.19"
27+
proc-macro2 = "1.0.79"
28+
quote = "1.0.35"
29+
serde = { version = "1.0.197", features = ["derive"] }
30+
serde_json = "1.0.115"
31+
serde_yaml = "0.9.34"
32+
syn = { version = "2.0.52", features = ["full", "visit"] }
2333

2434
[dev-dependencies]
25-
actix_web_mocks = { path = "src/actix_web_mocks" }
26-
diesel_mocks = { path = "src/diesel_mocks" }
35+
pretty_assertions = "1.4.0"
36+
tempfile = "3.10.1"

src/actix_web_mocks/COPYING

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/actix_web_mocks/Cargo.toml

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/actix_web_mocks/src/lib.rs

Lines changed: 0 additions & 111 deletions
This file was deleted.

src/diesel_mocks/COPYING

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/diesel_mocks/Cargo.toml

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/diesel_mocks/diesel.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/diesel_mocks/src/lib.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/diesel_mocks/src/models.rs

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/diesel_mocks/src/schema.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)