Skip to content

Commit 07e0eab

Browse files
fix(cli): fix datetime types compilation in separate -types crate (#16289)
* fix(cli): fix datetime types compilation in types crate Parameterize coreModulePath in the Rust model generator and copy core serde helper modules into the CLI-generated types crate so that #[serde(with = "crate::core::...")] attributes resolve at compile time. - Add coreModulePath config option to BaseRustConfigSchema - Add getCoreModulePath() to AbstractRustGeneratorContext - Replace all hardcoded crate::core:: paths with dynamic paths in structUtils, UnionGenerator, UndiscriminatedUnionGenerator, AliasGenerator - Copy flexible_datetime.rs, base64_bytes.rs, bigint_string.rs, number_serializers.rs into types crate src/core/ - Add chrono, base64, num-bigint, ordered-float deps to types crate - Add chrono/ordered_float re-exports to types crate prelude - Update Cargo.lock patching to include new deps Closes FER-11024 * fix: add chrono/num-bigint/ordered-float to CLI SDK deps for Cargo.lock resolution The types crate lists these as dependencies, but without [[package]] entries in the shipped Cargo.lock, cargo build --locked would reject the inconsistent lock file. Adding them to the SDK's own Cargo.toml ensures they are resolved in the lock file naturally. --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent a5a00f1 commit 07e0eab

115 files changed

Lines changed: 14228 additions & 834 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- summary: |
2+
Fix datetime, base64, bigint, and number types failing to compile
3+
in the generated -types crate by copying serde helper modules and
4+
adding missing dependencies.
5+
type: fix

generators/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@fern-api/core-utils": "workspace:*",
3838
"@fern-api/fs-utils": "workspace:*",
3939
"@fern-api/generator-cli": "workspace:*",
40+
"@fern-api/rust-base": "workspace:*",
4041
"@fern-api/rust-model": "workspace:*",
4142
"@fern-fern/ir-sdk": "67.0.0",
4243
"@types/node": "catalog:",

generators/cli/sdk/Cargo.lock

Lines changed: 151 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generators/cli/sdk/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ rustls = ["reqwest/rustls-tls-native-roots", "tokio-tungstenite/rustls-tls-nativ
5757
anyhow = "1"
5858
base64 = "0.22"
5959
bytes = "1"
60+
chrono = { version = "0.4", features = ["serde"] }
6061
clap = { version = "4", features = ["derive", "string", "env"] }
6162
clap_complete = "4"
6263
clap_mangen = "0.2"
@@ -65,6 +66,8 @@ dotenvy = "0.15"
6566
futures-util = "0.3"
6667
httpdate = "1"
6768
libc = "0.2"
69+
num-bigint = { version = "0.4", features = ["serde"] }
70+
ordered-float = { version = "4.5", features = ["serde"] }
6871
percent-encoding = "2.3.2"
6972
reqwest = { version = "0.12", features = ["json", "multipart", "stream"], default-features = false }
7073
serde = { version = "1", features = ["derive"] }

0 commit comments

Comments
 (0)