https://github.com/nsuresh9806/json_util_plugin
https://github.com/nsuresh9806/json_util_plugin
automation code-generation developer-tools gson jackson java-code-generation json-beautifier json-editor json-formatter json-manipulation json-parser json-processing json-schema json-to-java json-tools json-utils json-validator lombok pojo-generator vscode-extension
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nsuresh9806/json_util_plugin
- Owner: nsuresh9806
- License: mit
- Created: 2025-01-29T19:21:44.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-02-18T18:52:53.000Z (4 months ago)
- Last Synced: 2025-02-18T19:44:38.303Z (4 months ago)
- Topics: automation, code-generation, developer-tools, gson, jackson, java-code-generation, json-beautifier, json-editor, json-formatter, json-manipulation, json-parser, json-processing, json-schema, json-to-java, json-tools, json-utils, json-validator, lombok, pojo-generator, vscode-extension
- Language: Java
- Homepage:
- Size: 136 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# JSON Utility - Validator, Formatter and Java Model Generator
This plugin provides an efficient way to **validate**, **format**, and **auto generate** **Java model** classes from **JSON** input **dynamically**. It simplifies the workflow for developers dealing with JSON data and Java projects by ensuring the JSON structure is valid and converting it into clean, well-structured Java classes.
**Authors**: Suresh Nettur, and Akhil Dusi.
## Features
- **JSON Validator**: Automatically checks the given JSON input for syntax errors.
- **JSON Formatter**: Once the JSON is validated, the plugin provides a neatly formatted version of the JSON for better readability and usability.
- **Java Model Generator**: If the JSON validation passes, the plugin generates corresponding Java model classes based on the structure of the JSON. This includes fields, getters, setters, and support for nested objects and arrays.
- **Java Model Generator - Lombok**: Generates Lombok style Java model classes from the given JSON structure.## Requirements
## Installation
1. Open IntelliJ.
2. File -> Settings -> Plugins.
3. Search for "JSON Validator, Formatter and Java Model Generator".
4. Click Install to add the plugin to your workspace.
5. Once installed, open project, json file.
6. From Menu, select Code -> "Validate Format JSON And Generate Java Model" or "Validate Format JSON And Generate Java Lombok Model" to run the commands for validation, formatting, and Java class generation.**Opened JSON file Person.json**:
{
"name": "John Doe",
"age": 30,
"address": {
"city": "New York",
"zipcode": "10001"
},
"skills": ["Java", "TypeScript"]
}**Generated Java Class**:
import java.util.List;public class Person {
private String name;
private int age;
private Address address;
private List skills;// Getters and Setters
}public class Address {
private String city;
private String zipcode;// Getters and Setters
}**with Lombok**:
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;/*
Make sure to include lombok library in classpath or in pom.xml for maven projects,Example:
org.projectlombok\
lombok\
*/@Data
@AllArgsConstructor
@NoArgsConstructorpublic class Address {
private String city;
private String zipcode;
}import java.util.List;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;@Data
@AllArgsConstructor
@NoArgsConstructorpublic class Person {
private String name;
private int age;
private Address address;
private List<String> skills;
}## Known Issues
Handling of highly complex nested JSON structures may result in deeply nested Java classes, which might require further optimization in future versions.
Currently, only basic Java class structure (fields, getters, and setters) is supported.
Advanced Java features (such as constructors or annotations) will be considered in future updates.## License
This plugin is licensed under the [MIT License](LICENSE).
See the LICENSE file for details.## Disclaimer
- **Ethical Usage**: This tool is designed for ethical development and testing purposes only. Do not use it for any unethical or inappropriate activities.
- **PII/PHI Handling**: Avoid including personally identifiable information (PII) or protected health information (PHI) in the input spec. The developers are not responsible for any misuse of the plugin.### Support
For issues or questions, visit the GitHub repository or contact us via the IntelliJ IDEA Community.