Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elle-j/json-flattener
A program taking JSON input and outputting a flattened JSON object.
https://github.com/elle-j/json-flattener
Last synced: 28 days ago
JSON representation
A program taking JSON input and outputting a flattened JSON object.
- Host: GitHub
- URL: https://github.com/elle-j/json-flattener
- Owner: elle-j
- Created: 2021-04-01T21:06:17.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-03T08:35:46.000Z (over 3 years ago)
- Last Synced: 2024-11-07T15:51:23.257Z (3 months ago)
- Language: Java
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSON Flattener
A Java program taking JSON input and outputting a flattened JSON object.
## Prerequisites
* Install Java Development Kit (JDK)
* Includes:
* Java Compiler - For compiling Java source code
* Java Runtime Environment (JRE) & Java Virtual Machine (JVM) - For running Java byte code
* Downloads & Platform Specific Instructions:
* [Oracle JDK Installation Guide](https://docs.oracle.com/en/java/javase/16/install/overview-jdk-installation.html#GUID-8677A77F-231A-40F7-98B9-1FD0B48C346A)## Compile and Run the Program
1. Open a terminal window (e.g. GitBash) and change the directory to where you want to place the cloned repo.
2. Clone the repo
```bash
# using ssh
git clone [email protected]:elle-j/JSON-Flattener.git# using https
git clone https://github.com/elle-j/JSON-Flattener.git
```3. Change directory to the source code directory
```bash
cd ./JSON-Flattener/java-program/src/
```4. Compile the source code
```bash
javac -cp . ./dev/ellej/*.java
```5. Run the program
```bash
# replace with a valid JSON object
java dev.ellej.Main# example 1:
java dev.ellej.Main '{ "a": 1, "b": true, "c": { "d": 3, "e": "test" } }'# example 2:
cat /path/to/file.json | java dev.ellej.Main
```## Assumptions
* The program will always receive an input when run
* The input will always be a valid JSON object
* The JSON object will not contain arrays