Skip to content

fix(fixed-charge): Accept null invoice_display_name in responses - #432

Merged
groyoh merged 1 commit into
mainfrom
fix/bil-995-fixed-charge-null-display-name
Oct 29, 2026
Merged

groyoh merged 1 commit into
mainfrom
fix/bil-995-fixed-charge-null-display-name

Conversation

@lago-claude-ai-agent

@lago-claude-ai-agent lago-claude-ai-agent Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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 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

## 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
groyoh marked this pull request as ready for review October 29, 2026 12:20
@groyoh
groyoh merged commit 98dec8f into main Oct 29, 2026
7 checks passed
@groyoh
groyoh deleted the fix/bil-995-fixed-charge-null-display-name branch October 29, 2026 12:20
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.

1 participant