Skip to content

Commit

Permalink
Improve typing of Stripe::ApiResource#metadata
Browse files Browse the repository at this point in the history
Per the docs, values are always strings (there is no nesting). I opted to not change the signature of `#metadata=` because you can technically pass in non-strings to the method and either the values will be stringified (e.g. `1` becomes `"1"`) or the keys ignored (e.g. a key with a `nil` value).

https://docs.stripe.com/metadata
  • Loading branch information
magni- authored Feb 20, 2025
1 parent 669a940 commit e96ac79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rbi/annotations/stripe.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Stripe::APIResource < Stripe::StripeObject

# not all objects, at all times have metadata (deleted customers for instance)
# @method_missing: from StripeObject
sig { returns(T::Hash[T.any(String, Symbol), T.untyped]) }
sig { returns(T::Hash[T.any(String, Symbol), String]) }
def metadata; end

# @method_missing: from StripeObject
Expand Down

0 comments on commit e96ac79

Please sign in to comment.