'Java : Externalize JSON processing outside of code

I am writing an API, which accepts a JSON string from multiple providers

It will receive JSON with different structure, and it will be parsed to fetch some information and saved to an Object

The problem here is, the API can receive any JSON structure, so I can't hard code parsing logic.

I can detect which provider it came from, so is there any way to seed JSON parsing/transformation logic at runtime based on the provider?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source