Repository navigation
fix(fixed-charge): Accept null invoice_display_name in responses - #432
Merged
Merged
Conversation
## Context Updating, finding or listing a fixed charge that has no invoice display name raises a pydantic validation error in the client. The error reads `none is not an allowed value` for `invoice_display_name` on `FixedChargeResponse`. For an update, the API has already applied the change, so the caller sees a failure for a request that worked. The API returns `"invoice_display_name": null` for these fixed charges, because the field is optional and its schema allows null. The client model declared the field as a required `str`, so it rejected the null. ## Description `FixedChargeResponse.invoice_display_name` is now `Optional[str]`. A response with a null value parses and the attribute is `None`. Non-null values parse as before. This matches the other optional fields on the same model, such as `code`, and the `invoice_display_name` field on the other response models. The model is shared by the subscription fixed charges client, the plan fixed charges client and `PlanResponse.fixed_charges`, so one change covers all three. Request models already accepted a missing display name and are unchanged. The loop took no decisions of its own beyond this field type. The tests are outside the model file. They cover a null display name on the subscription fixed charge update and list calls, the plan fixed charge find call and the plan find call. The change was also checked against a running Lago API v1.55.0 server. The ticket's case fails without the fix and passes with it. Fixes BIL-995 Signed-off-by: lago-claude-ai-agent[bot] <297187938+lago-claude-ai-agent[bot]@users.noreply.github.com>
groyoh
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Updating, finding or listing a fixed charge that has no invoice display name raises a pydantic validation error in the client. The error reads
none is not an allowed valueforinvoice_display_nameonFixedChargeResponse. For an update, the API has already applied the change, so the caller sees a failure for a request that worked.The API returns
"invoice_display_name": nullfor these fixed charges, because the field is optional and its schema allows null. The client model declared the field as a requiredstr, so it rejected the null.Description
FixedChargeResponse.invoice_display_nameis nowOptional[str]. A response with a null value parses and the attribute isNone. Non-null values parse as before. This matches the other optional fields on the same model, such ascode, and theinvoice_display_namefield on the other response models.The model is shared by the subscription fixed charges client, the plan fixed charges client and
PlanResponse.fixed_charges, so one change covers all three. Request models already accepted a missing display name and are unchanged.The new tests cover a null display name on the subscription fixed charge update and list calls, the plan fixed charge find call and the plan find call.
The change was also checked against a Lago API v1.55.0 server. Reading a plan with a fixed charge that has no display name fails without the fix and passes with it, and so do the plan fixed charge and subscription fixed charge lists. The subscription fixed charge update needs a premium license, so it was not checked there.
Fixes BIL-995