Skip to content

Commit 9ebb823

Browse files
fix(api): Allow null values for optional enum and object fields in schema validation
1 parent 9a96636 commit 9ebb823

19 files changed

Lines changed: 106 additions & 146 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 191
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d29b68bb85936070878d8badaa8a7c5991313285e70a990bc812c838eba85373.yml
3-
openapi_spec_hash: 54b44da68df22eb0ea99f2bc564667a2
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-dc8aacc11d74a1e25c95ba549dd0f4a4e735cbf7562fc6b17b0c81d62fd5475c.yml
3+
openapi_spec_hash: 1906583f260a3e9ace5ae38fd2254763
44
config_hash: ac8326134e692f3f3bdec82396bbec80

lib/lithic/models/account.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class Account < Lithic::Internal::Type::BaseModel
102102
# particular reason.
103103
#
104104
# @return [Symbol, Lithic::Models::Account::Substatus, nil]
105-
optional :substatus, enum: -> { Lithic::Account::Substatus }
105+
optional :substatus, enum: -> { Lithic::Account::Substatus }, nil?: true
106106

107107
# @!attribute verification_address
108108
# @deprecated
@@ -130,7 +130,7 @@ class Account < Lithic::Internal::Type::BaseModel
130130
#
131131
# @param comment [String] Additional context or information related to the account.
132132
#
133-
# @param substatus [Symbol, Lithic::Models::Account::Substatus] Account state substatus values:
133+
# @param substatus [Symbol, Lithic::Models::Account::Substatus, nil] Account state substatus values:
134134
#
135135
# @param verification_address [Lithic::Models::Account::VerificationAddress]
136136

lib/lithic/models/account_holder_simulate_enrollment_review_response.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ class AccountHolderSimulateEnrollmentReviewResponse < Lithic::Internal::Type::Ba
7575
optional :email, String
7676

7777
# @!attribute exemption_type
78-
# The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
78+
# The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
7979
# holder is not KYC-Exempt.
8080
#
8181
# @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType, nil]
8282
optional :exemption_type,
83-
enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType }
83+
enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType },
84+
nil?: true
8485

8586
# @!attribute external_id
8687
# Customer-provided token that indicates a relationship with an object outside of
@@ -188,7 +189,7 @@ class AccountHolderSimulateEnrollmentReviewResponse < Lithic::Internal::Type::Ba
188189
#
189190
# @param email [String] (Deprecated. Use control_person.email when user_type == "BUSINESS".
190191
#
191-
# @param exemption_type [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType] The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
192+
# @param exemption_type [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType, nil] The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
192193
#
193194
# @param external_id [String] Customer-provided token that indicates a relationship with an object outside of
194195
#
@@ -465,7 +466,7 @@ class Address < Lithic::Internal::Type::BaseModel
465466
end
466467
end
467468

468-
# The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
469+
# The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
469470
# holder is not KYC-Exempt.
470471
#
471472
# @see Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse#exemption_type

lib/lithic/models/account_holder_update_response.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class KYBKYCPatchResponse < Lithic::Internal::Type::BaseModel
8282
optional :email, String
8383

8484
# @!attribute exemption_type
85-
# The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
85+
# The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
8686
# holder is not KYC-Exempt.
8787
#
8888
# @return [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType, nil]
@@ -196,7 +196,7 @@ class KYBKYCPatchResponse < Lithic::Internal::Type::BaseModel
196196
#
197197
# @param email [String] (Deprecated. Use control_person.email when user_type == "BUSINESS".
198198
#
199-
# @param exemption_type [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType] The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
199+
# @param exemption_type [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType] The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
200200
#
201201
# @param external_id [String] Customer-provided token that indicates a relationship with an object outside of
202202
#
@@ -473,7 +473,7 @@ class Address < Lithic::Internal::Type::BaseModel
473473
end
474474
end
475475

476-
# The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
476+
# The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
477477
# holder is not KYC-Exempt.
478478
#
479479
# @see Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse#exemption_type

lib/lithic/models/account_update_params.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class AccountUpdateParams < Lithic::Internal::Type::BaseModel
8080
# particular reason.
8181
#
8282
# @return [Symbol, Lithic::Models::AccountUpdateParams::Substatus, nil]
83-
optional :substatus, enum: -> { Lithic::AccountUpdateParams::Substatus }
83+
optional :substatus, enum: -> { Lithic::AccountUpdateParams::Substatus }, nil?: true
8484

8585
# @!attribute verification_address
8686
# @deprecated
@@ -109,7 +109,7 @@ class AccountUpdateParams < Lithic::Internal::Type::BaseModel
109109
#
110110
# @param state [Symbol, Lithic::Models::AccountUpdateParams::State] Account states.
111111
#
112-
# @param substatus [Symbol, Lithic::Models::AccountUpdateParams::Substatus] Account state substatus values:
112+
# @param substatus [Symbol, Lithic::Models::AccountUpdateParams::Substatus, nil] Account state substatus values:
113113
#
114114
# @param verification_address [Lithic::Models::AccountUpdateParams::VerificationAddress] Address used during Address Verification Service (AVS) checks during transaction
115115
#

lib/lithic/models/non_pci_card.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ class NonPCICard < Lithic::Internal::Type::BaseModel
2929
required :created, Time
3030

3131
# @!attribute funding
32-
# Deprecated: Funding account for the card.
32+
# Funding account for a card
3333
#
34-
# @return [Lithic::Models::NonPCICard::Funding]
35-
required :funding, -> { Lithic::NonPCICard::Funding }
34+
# @return [Lithic::Models::NonPCICard::Funding, nil]
35+
required :funding, -> { Lithic::NonPCICard::Funding }, nil?: true
3636

3737
# @!attribute last_four
3838
# Last four digits of the card number.
@@ -141,7 +141,7 @@ class NonPCICard < Lithic::Internal::Type::BaseModel
141141
# by Lithic to use.
142142
#
143143
# @return [String, nil]
144-
optional :digital_card_art_token, String
144+
optional :digital_card_art_token, String, nil?: true
145145

146146
# @!attribute exp_month
147147
# Two digit (MM) expiry month.
@@ -189,7 +189,7 @@ class NonPCICard < Lithic::Internal::Type::BaseModel
189189
# should be manufactured with.
190190
#
191191
# @return [String, nil]
192-
optional :product_id, String
192+
optional :product_id, String, nil?: true
193193

194194
# @!attribute replacement_for
195195
# If the card is a replacement for another card, the globally unique identifier
@@ -221,7 +221,7 @@ class NonPCICard < Lithic::Internal::Type::BaseModel
221221
# of the above categories. A comment can be provided to specify the reason.
222222
#
223223
# @return [Symbol, Lithic::Models::NonPCICard::Substatus, nil]
224-
optional :substatus, enum: -> { Lithic::NonPCICard::Substatus }
224+
optional :substatus, enum: -> { Lithic::NonPCICard::Substatus }, nil?: true
225225

226226
# @!method initialize(token:, account_token:, card_program_token:, created:, funding:, last_four:, pin_status:, spend_limit:, spend_limit_duration:, state:, type:, auth_rule_tokens: nil, bulk_order_token: nil, cardholder_currency: nil, comment: nil, digital_card_art_token: nil, exp_month: nil, exp_year: nil, hostname: nil, memo: nil, network_program_token: nil, pending_commands: nil, product_id: nil, replacement_for: nil, substatus: nil)
227227
# Some parameter documentations has been truncated, see
@@ -237,7 +237,7 @@ class NonPCICard < Lithic::Internal::Type::BaseModel
237237
#
238238
# @param created [Time] An RFC 3339 timestamp for when the card was created. UTC time zone.
239239
#
240-
# @param funding [Lithic::Models::NonPCICard::Funding] Deprecated: Funding account for the card.
240+
# @param funding [Lithic::Models::NonPCICard::Funding, nil] Funding account for a card
241241
#
242242
# @param last_four [String] Last four digits of the card number.
243243
#
@@ -261,7 +261,7 @@ class NonPCICard < Lithic::Internal::Type::BaseModel
261261
#
262262
# @param comment [String] Additional context or information related to the card.
263263
#
264-
# @param digital_card_art_token [String] Specifies the digital card art to be displayed in the user's digital wallet afte
264+
# @param digital_card_art_token [String, nil] Specifies the digital card art to be displayed in the user's digital wallet afte
265265
#
266266
# @param exp_month [String] Two digit (MM) expiry month.
267267
#
@@ -275,11 +275,11 @@ class NonPCICard < Lithic::Internal::Type::BaseModel
275275
#
276276
# @param pending_commands [Array<String>] Indicates if there are offline PIN changes pending card interaction with an offl
277277
#
278-
# @param product_id [String] Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic
278+
# @param product_id [String, nil] Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic
279279
#
280280
# @param replacement_for [String, nil] If the card is a replacement for another card, the globally unique identifier fo
281281
#
282-
# @param substatus [Symbol, Lithic::Models::NonPCICard::Substatus] Card state substatus values: \* `LOST` - The physical card is no longer in the
282+
# @param substatus [Symbol, Lithic::Models::NonPCICard::Substatus, nil] Card state substatus values: \* `LOST` - The physical card is no longer in the
283283
# ca
284284

285285
# @see Lithic::Models::NonPCICard#funding
@@ -330,13 +330,13 @@ class Funding < Lithic::Internal::Type::BaseModel
330330
# The nickname given to the `FundingAccount` or `null` if it has no nickname.
331331
#
332332
# @return [String, nil]
333-
optional :nickname, String
333+
optional :nickname, String, nil?: true
334334

335335
# @!method initialize(token:, created:, last_four:, state:, type:, account_name: nil, nickname: nil)
336336
# Some parameter documentations has been truncated, see
337337
# {Lithic::Models::NonPCICard::Funding} for more details.
338338
#
339-
# Deprecated: Funding account for the card.
339+
# Funding account for a card
340340
#
341341
# @param token [String] A globally unique identifier for this FundingAccount.
342342
#
@@ -351,7 +351,7 @@ class Funding < Lithic::Internal::Type::BaseModel
351351
#
352352
# @param account_name [String] Account name identifying the funding source. This may be `null`.
353353
#
354-
# @param nickname [String] The nickname given to the `FundingAccount` or `null` if it has no nickname.
354+
# @param nickname [String, nil] The nickname given to the `FundingAccount` or `null` if it has no nickname.
355355

356356
# State of funding source. Funding source states: _ `ENABLED` - The funding
357357
# account is available to use for card creation and transactions. _ `PENDING` -

lib/lithic/resources/accounts.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def retrieve(account_token, params = {})
4444
#
4545
# @param state [Symbol, Lithic::Models::AccountUpdateParams::State] Account states.
4646
#
47-
# @param substatus [Symbol, Lithic::Models::AccountUpdateParams::Substatus] Account state substatus values:
47+
# @param substatus [Symbol, Lithic::Models::AccountUpdateParams::Substatus, nil] Account state substatus values:
4848
#
4949
# @param verification_address [Lithic::Models::AccountUpdateParams::VerificationAddress] Address used during Address Verification Service (AVS) checks during transaction
5050
#

rbi/lithic/models/account.rbi

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ module Lithic
101101
# of the above categories. A comment should be provided to specify the
102102
# particular reason.
103103
sig { returns(T.nilable(Lithic::Account::Substatus::TaggedSymbol)) }
104-
attr_reader :substatus
105-
106-
sig { params(substatus: Lithic::Account::Substatus::OrSymbol).void }
107-
attr_writer :substatus
104+
attr_accessor :substatus
108105

109106
sig { returns(T.nilable(Lithic::Account::VerificationAddress)) }
110107
attr_reader :verification_address
@@ -126,7 +123,7 @@ module Lithic
126123
auth_rule_tokens: T::Array[String],
127124
cardholder_currency: String,
128125
comment: String,
129-
substatus: Lithic::Account::Substatus::OrSymbol,
126+
substatus: T.nilable(Lithic::Account::Substatus::OrSymbol),
130127
verification_address: Lithic::Account::VerificationAddress::OrHash
131128
).returns(T.attached_class)
132129
end
@@ -208,7 +205,7 @@ module Lithic
208205
auth_rule_tokens: T::Array[String],
209206
cardholder_currency: String,
210207
comment: String,
211-
substatus: Lithic::Account::Substatus::TaggedSymbol,
208+
substatus: T.nilable(Lithic::Account::Substatus::TaggedSymbol),
212209
verification_address: Lithic::Account::VerificationAddress
213210
}
214211
)

rbi/lithic/models/account_holder_simulate_enrollment_review_response.rbi

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ module Lithic
110110
sig { params(email: String).void }
111111
attr_writer :email
112112

113-
# The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
113+
# The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
114114
# holder is not KYC-Exempt.
115115
sig do
116116
returns(
@@ -119,15 +119,7 @@ module Lithic
119119
)
120120
)
121121
end
122-
attr_reader :exemption_type
123-
124-
sig do
125-
params(
126-
exemption_type:
127-
Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::OrSymbol
128-
).void
129-
end
130-
attr_writer :exemption_type
122+
attr_accessor :exemption_type
131123

132124
# Customer-provided token that indicates a relationship with an object outside of
133125
# the Lithic ecosystem.
@@ -301,7 +293,9 @@ module Lithic
301293
created: Time,
302294
email: String,
303295
exemption_type:
304-
Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::OrSymbol,
296+
T.nilable(
297+
Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::OrSymbol
298+
),
305299
external_id: String,
306300
individual:
307301
Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::OrHash,
@@ -359,7 +353,7 @@ module Lithic
359353
# individual.phone_number when user_type == "INDIVIDUAL".) Primary email of
360354
# Account Holder.
361355
email: nil,
362-
# The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
356+
# The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
363357
# holder is not KYC-Exempt.
364358
exemption_type: nil,
365359
# Customer-provided token that indicates a relationship with an object outside of
@@ -420,7 +414,9 @@ module Lithic
420414
created: Time,
421415
email: String,
422416
exemption_type:
423-
Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol,
417+
T.nilable(
418+
Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol
419+
),
424420
external_id: String,
425421
individual:
426422
Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual,
@@ -850,7 +846,7 @@ module Lithic
850846
end
851847
end
852848

853-
# The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
849+
# The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
854850
# holder is not KYC-Exempt.
855851
module ExemptionType
856852
extend Lithic::Internal::Type::Enum

rbi/lithic/models/account_holder_update_response.rbi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ module Lithic
121121
sig { params(email: String).void }
122122
attr_writer :email
123123

124-
# The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
124+
# The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
125125
# holder is not KYC-Exempt.
126126
sig do
127127
returns(
@@ -370,7 +370,7 @@ module Lithic
370370
# individual.phone_number when user_type == "INDIVIDUAL".) Primary email of
371371
# Account Holder.
372372
email: nil,
373-
# The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
373+
# The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
374374
# holder is not KYC-Exempt.
375375
exemption_type: nil,
376376
# Customer-provided token that indicates a relationship with an object outside of
@@ -861,7 +861,7 @@ module Lithic
861861
end
862862
end
863863

864-
# The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
864+
# The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
865865
# holder is not KYC-Exempt.
866866
module ExemptionType
867867
extend Lithic::Internal::Type::Enum

0 commit comments

Comments
 (0)