Giter Site home page Giter Site logo

hemantsonu20 / json-merge Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 5.0 138 KB

A light weight library to merge two json objects into a single json object.

License: Apache License 2.0

Java 100.00%
java json json-merge maven hacktoberfest hacktoberfest2020

json-merge's Introduction

Hi ๐Ÿ‘‹, I'm Hemant Patel
hemantsonu20 3295987 hemantsonu20

My Skills

Languages Backend Development Frontend Development Devops
java javascript typescript spring mongodb cassandra kafka react NextJS angularjs bootstrap docker jenkins Kubernetes

My Github Stats

ย hemantsonu20

json-merge's People

Contributors

dependabot[bot] avatar hemantsonu20 avatar syfds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

json-merge's Issues

Validation of input json string in the main merge method

The main merge method accepts two json strings (JsonMerge.merge(srcJsonStr, targetJsonStr);). There is no input validation for non correct values like null or "" or " ". For example invocation with null produces following error: java.lang.IllegalArgumentException: argument "content" is null

I suggest to validate input strings and throw a corresponding exception like IllegalArgumentException with a clear error message.

@hemantsonu20 what do you thing about it? If it's ok for you, I will create a pull request.

Add test cases for this lib

This lib merges two json objects into a single json object. Few test cases with multi level and complex json will test the robustness of this lib.

Add some complex test cases for this lib

A sample test file:

[
  {
    "name": "json-merge"
  },
  {
    "age": 18
  },
  {
    "name": "json-merge",
    "age": 18
  }
]

Every test file will contain three json objects. First one is the src json, second one is target json, third one is expected output.

So just create some complex test cases in same pattern and define expected output.

Note: Adding just json file in test folder will be picked by junit test. No additonal code is required for running the test case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.