JSON to Java POJO Converter
Json Code
Generated Entity
Paste JSON to generate Lombok-annotated Java classes
JSON to Java Advanced Guide
How to handle property naming?
Smart solutions:
1. CamelCase: user_id → userId
2. Keywords: Prefix with @ (e.g. @class)
3. Sanitization: Remove $/- symbols
4. Case preservation: Optional config
5. Lombok: @JsonProperty("original_name")
1. CamelCase: user_id → userId
2. Keywords: Prefix with @ (e.g. @class)
3. Sanitization: Remove $/- symbols
4. Case preservation: Optional config
5. Lombok: @JsonProperty("original_name")
Correct date type mapping?
Multiple approaches:
1. ISO8601: LocalDateTime/LocalDate
2. Timestamps: Convert to Instant
3. Gson: @SerializedName + DateFormat
4. Jackson: @JsonFormat(pattern="yyyy-MM-dd")
5. Custom: Generate JsonDeserializer
1. ISO8601: LocalDateTime/LocalDate
2. Timestamps: Convert to Instant
3. Gson: @SerializedName + DateFormat
4. Jackson: @JsonFormat(pattern="yyyy-MM-dd")
5. Custom: Generate JsonDeserializer
Best practices for complex structures
Professional solutions:
1. Recursive generation: Inner classes for nesting
2. Generics: List
1. Recursive generation: Inner classes for nesting
2. Generics: List