Skip to content

refactor(api_models): remove deny_unknown_fields from v2 customers and payment_methods DTOs - #14287

Open
ShankarSinghC wants to merge 2 commits into
mainfrom
remove-deny-unknown-fields-v2-modular-pm
Open

ShankarSinghC wants to merge 2 commits into
mainfrom
remove-deny-unknown-fields-v2-modular-pm

Conversation

@ShankarSinghC

Copy link
Copy Markdown
Contributor

Summary

  • Removes #[serde(deny_unknown_fields)] from the v2 (feature = "v2") request DTOs used by /v2/customers and /v2/payment-methods: CustomerRequest, CustomerUpdateRequest, PaymentMethodRetrieveRequest, PaymentMethodCreate, PaymentMethodIntentCreate, PaymentMethodIntentConfirm, PaymentMethodUpdate, and the nested PaymentMethodCreateData/PaymentMethodUpdateData enums.
  • Brings these routes in line with /v2/payment-method-sessions, whose request DTOs never had deny_unknown_fields in the first place, so unknown fields are now handled consistently (ignored) across all three modular payment-method route groups.
  • v1 DTOs and non-JSON-body routes (query params, multipart) are untouched.

Test plan

  • cargo check --no-default-features --features "release,v2,redis-rs" (same command as CI's check-v2 job) passes.
  • Manual/API-level verification that /v2/customers and /v2/payment-methods create/update endpoints now accept a request body with an extra unrecognized field instead of returning a 400.

🤖 Generated with Claude Code

…d payment_methods DTOs

Aligns v2 customers, payment_methods, and payment_method_sessions request
DTOs by removing the deny_unknown_fields restriction from customer
create/update and payment-method create/intent-create/intent-confirm/update
requests (and their nested payment_method_data enums), matching the
already-permissive behavior of payment_method_sessions DTOs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ShankarSinghC
ShankarSinghC requested review from a team as code owners September 17, 2026 11:10
@semanticdiff-com

semanticdiff-com Bot commented Sep 17, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  api-reference/v2/openapi_spec_v2.json  67% smaller
  crates/api_models/src/customers.rs  0% smaller
  crates/api_models/src/payment_methods.rs  0% smaller

@hyperswitch-bot hyperswitch-bot Bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

M-api-contract-changes Metadata: This PR involves API contract changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant