Skip to content

Conversation

mzieniukbw
Copy link
Contributor

@mzieniukbw mzieniukbw commented Oct 13, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-24051

📔 Objective

Added pascal-case serde serialisation alias for all OpenApi generated models.

Issue: The OpenApi generated models only contain the camel-case name of the field. This does not work during deserialisation of Bitwarden server responses, since most of them are in pascal-case.

Persistent models update will be taken care of by Update API Bindings GH workflow, once merged.

Example model updated:

 #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
 pub struct MasterPasswordUnlockResponseModel {
-    #[serde(rename = "kdf")]
+    #[serde(rename = "kdf", alias = "Kdf")]
     pub kdf: Box<models::MasterPasswordUnlockKdfResponseModel>,
-    #[serde(rename = "masterKeyEncryptedUserKey")]
+    #[serde(
+        rename = "masterKeyEncryptedUserKey",
+        alias = "MasterKeyEncryptedUserKey"
+    )]
     pub master_key_encrypted_user_key: Option<String>,
-    #[serde(rename = "salt")]
+    #[serde(rename = "salt", alias = "Salt")]
     pub salt: Option<String>,
 }

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@mzieniukbw mzieniukbw requested a review from a team as a code owner October 13, 2025 15:35
Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Detailsab2cec18-402e-42a5-bf6a-2bb5e87dbb9e

Great job! No new security vulnerabilities introduced in this pull request

Copy link

Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.98%. Comparing base (a0531e8) to head (b93237e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #512   +/-   ##
=======================================
  Coverage   77.98%   77.98%           
=======================================
  Files         287      287           
  Lines       27673    27673           
=======================================
  Hits        21582    21582           
  Misses       6091     6091           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mzieniukbw mzieniukbw merged commit 6474d6f into main Oct 13, 2025
55 checks passed
@mzieniukbw mzieniukbw deleted the km/server-field-naming-serialization branch October 13, 2025 18:47
bw-ghapp bot pushed a commit to bitwarden/sdk-swift that referenced this pull request Oct 13, 2025
…i generated models with pascal-case alias for serde serialization (bitwarden/sdk-internal#512)
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.

2 participants