palantir-java-format icon indicating copy to clipboard operation
palantir-java-format copied to clipboard

Java Record formatting issue

Open marceloverdijk opened this issue 5 months ago • 0 comments

I'm using latest palantir java format (2.65.0) with Spotless and this is the formatted output:

import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(name = "Continent", description = "Representation of a continent.")
public record ContinentDto(
        @Schema(type = "string", description = "The unique identifier for the continent.", requiredMode = REQUIRED)
                String id,
        @Schema(
                        type = "string",
                        description = "The unique code of the continent.",
                        minLength = 2,
                        maxLength = 2,
                        pattern = "^[A-Z]{2}$",
                        requiredMode = REQUIRED)
                String code,
        @Schema(type = "string", description = "The name of the continent.", requiredMode = REQUIRED) String name,
        @Schema(
                        type = "string",
                        description = "The demonym used for people from the continent.",
                        requiredMode = REQUIRED)
                String demonym) {}

This looks quite bizarre imo.

marceloverdijk avatar May 09 '25 10:05 marceloverdijk