Skip to content

Change enum serialization to lowercase#200

Open
randomlogin wants to merge 1 commit intolightningdevkit:mainfrom
randomlogin:api-use-lowercase-strings
Open

Change enum serialization to lowercase#200
randomlogin wants to merge 1 commit intolightningdevkit:mainfrom
randomlogin:api-use-lowercase-strings

Conversation

@randomlogin
Copy link
Copy Markdown

Changed the serialization macros to lowercase enum names.

Strings like "COOPERATIVE_CLOSURE", "SUCCEEDED", or "SIGNET" look unnatural in CLI output and human-facing JSON, even though SCREAMING_SNAKE_CASE is the proto3 default.

This relies on enum variants following the proto style guide (UPPER_SNAKE_CASE); a future variant using acronyms or mixed case (e.g. HTTPSEndpoint) would lowercase awkwardly. All current variants are clean.

Note: this is a breaking change for any existing JSON consumer of PaymentDirection, PaymentStatus, or BalanceSource.

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented May 5, 2026

👋 Thanks for assigning @benthecarman as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@benthecarman benthecarman self-requested a review May 5, 2026 19:31
Copy link
Copy Markdown
Collaborator

@benthecarman benthecarman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh I don't really love this, seeing status: SUCCEEDED feels more like an enum whereas status: succeeded feels like someone hard coded a string to me

@randomlogin
Copy link
Copy Markdown
Author

tbh I don't really love this, seeing status: SUCCEEDED feels more like an enum whereas status: succeeded feels like someone hard coded a string to me

Can it be so because you know the internals and the fact that there is an enum?
Funny enough, it makes me feel the contrary: in "naturally occurring" JSONs an uppercase field gives a suspicion that something went wrong in a piece of software and I received a response encoded for a machine and maybe I need to recheck if there was no error.

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.

3 participants