Skip to content

Java Record formatting issue #1292

@marceloverdijk

Description

@marceloverdijk

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.

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