Skip to content

A program taking JSON input and outputting a flattened JSON object.

Notifications You must be signed in to change notification settings

elle-j/JSON-Flattener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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:

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
# using ssh
git clone git@github.com:elle-j/JSON-Flattener.git

# using https
git clone https://github.com/elle-j/JSON-Flattener.git
  1. Change directory to the source code directory
cd ./JSON-Flattener/java-program/src/
  1. Compile the source code
javac -cp . ./dev/ellej/*.java
  1. Run the program
# replace <json_object> with a valid JSON object
java dev.ellej.Main <json_object>

# 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

About

A program taking JSON input and outputting a flattened JSON object.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published