HubSpot / jinjava

Jinja template engine for Java
Apache License 2.0
705 stars 170 forks source link

Add support for java records #1163

Open bdshadow opened 9 months ago

bdshadow commented 9 months ago
public record MyRecord(String recordName) {

    /**
     * without explicit getter Jinjava doesn't see it
     */
    public String getRecordName() {
        return recordName;
    }
}

The following template won't be correctly filled without the getter, although it's not needed for records

{{ myRecord.recordName }}

I tried to contribute, but it turned out, that the java version in the base pom.xml is still 8. https://github.com/HubSpot/basepom/blob/master/pom.xml#L17. I think such change must be done by the core maintainers, who know all of the possible implications.

It's 2024, time to go for java 21+

jasmith-hs commented 9 months ago

We are thinking of doing a major version release and bumping to Java 17 very soon, and then not too long after that we can bump to Java 21.