Skip to content

feat(functions-tools)!: convert camelCase field names to snake_case#849

Merged
peterpeterparker merged 2 commits intomainfrom
feat/snake-case
Mar 29, 2026
Merged

feat(functions-tools)!: convert camelCase field names to snake_case#849
peterpeterparker merged 2 commits intomainfrom
feat/snake-case

Conversation

@peterpeterparker
Copy link
Copy Markdown
Contributor

Motivation

For some reason never used a camel case. Discovered while testing: junobuild/juno#2634

So we need to convert to snake case - since we already do for functions' name - for fields and use serde to rename for the bridge with JS.

   Compiling sputnik v0.3.1 (/Users/daviddalbusco/projects/juno/juno/src/sputnik)
warning: structure field `maxResponseBytes` should have a snake case name
   --> src/sputnik/src/generated.rs:401:9
    |
401 |     pub maxResponseBytes: Option<u64>,
    |         ^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `max_response_bytes`
    |
    = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default

warning: structure field `isReplicated` should have a snake case name
   --> src/sputnik/src/generated.rs:403:9
    |
403 |     pub isReplicated: Option<bool>,
    |         ^^^^^^^^^^^^ help: convert the identifier to snake case: `is_replicated`

Coming from generated code

#[derive(CandidType, Serialize, Deserialize, Clone, JsonData)]
pub struct AppHttpRequestArgs {
    pub url: String,
    pub method: AppHttpRequestArgsMethod,
    pub headers: Vec<AppHttpRequestArgsHeaders>,
    pub body: Option<Vec<u8>>,
    pub maxResponseBytes: Option<u64>,
    pub transform: Option<String>,
    pub isReplicated: Option<bool>,
}

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
@junobuild/admin 6.24 KB (0%)
@junobuild/core 15.34 KB (0%)
@junobuild/core-worker 21.74 KB (0%)
@junobuild/core-standalone 69.64 KB (0%)
@junobuild/utils 335 B (0%)
@junobuild/errors 1014 B (0%)
@junobuild/functions 2.19 KB (0%)
@junobuild/analytics 12.3 KB (0%)
@junobuild/config 7.15 KB (0%)
@junobuild/auth/delegation 2.51 KB (0%)
@junobuild/auth/automation 761 B (0%)
@junobuild/cdn 971 B (0%)
@junobuild/storage 988 B (0%)
@junobuild/ic-client/actor 7.22 KB (0%)
@junobuild/ic-client/webauthn 1.96 KB (0%)
@junobuild/ic-client/utils 174 B (0%)
@junobuild/ic-client/index 62 B (0%)

@peterpeterparker peterpeterparker merged commit 3dfa1d5 into main Mar 29, 2026
@peterpeterparker peterpeterparker deleted the feat/snake-case branch March 29, 2026 11:04
@peterpeterparker peterpeterparker changed the title feat(functions-tools): convert camelCase field names to snake_case feat(functions-tools)!: convert camelCase field names to snake_case Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant