Skip to content

Camel/Snake case inconsistency in Pledge class is breaking Java Spring IntegrationΒ #24

@decmurphy

Description

@decmurphy

I'm trying to make API calls to get all of my campaigns pledges and then cache them for some time on my server, so as to avoid querying the Patreon servers too much. I'm storing the JSON results of

fetchAllPledges(String campaignId)
and the Rewards subsection of
fetchCampaigns()

in a MongoDB database, and using Spring Repositories to save to and to read from the database.

Spring makes assumptions about variable names based in Java convention. If a field name is amount_cents, it will call a getter getAmount_cents(). If that field name is amountCents, it will call getAmountCents(), and so on.

For some reason, the member variables of the Pledge class are camelCase, even though the variables entered into the constructor are snake_case. This isn't the situation in, for example, the Reward class where both the member variables and the constructor parameters are in snake_case and Spring performs perfectly.

Petition to modify the member variables of Pledge to use a consistent case scheme. Spring doesn't care which scheme is used, as long as there is consistency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions