Skip to content

[REQ] Spring: Add option to disable creating toString()-Method #14156

@DevilJul

Description

@DevilJul

Currently, the POJO always contains a toString()-Method containing all fields.
This can be a problem if the POJO is logged and contains sensitive data.

I suggest a configuration-parameter "excludeToString" so that the toString method is not generated anymore.

As Lombok is widely used it's often the preferred way to generate this method:

  1. Setting configuration additionalModelTypeAnnotations = @lombok.ToString
  2. Setting x-field-extra-annotation: ""@lombok.ToString.Include"/ "@lombok.ToString.Exclude" in API.yaml

Of course I can customize the mustache template and use this but I think this feature might be useful for quite a lot of people.

I'd happily contribute this feature as PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions