Annotation Type JsonProperty


@Retention(CLASS) @Target(FIELD) public @interface JsonProperty

Renames a @Mapped field in the JSON projection. The default JSON key is the field name; @JsonProperty lets a field map to snake_case or any alternative spelling without touching the Java identifier.

The server's generated codecs read it too, so a class shared between an app and its backend has one JSON form on both sides.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The JSON key.
  • Element Details

    • value

      String value
      The JSON key.