1

In Java, is there a way to generate Json schema from Json String without having the Model class of the object?

Note: I tried using Jackson library and seems it requires the Model class. Also, I am not asking how to generate Java class from Json String, I just need Json Schema out of Json String.

4
  • @user3145373ツ - I don't need Java class, just the JSON schema. Commented Dec 16, 2016 at 12:06
  • Possible duplicate; stackoverflow.com/questions/7341537/… Commented Dec 16, 2016 at 12:10
  • @RC. - I couldn't find a java based solution in that post. Commented Dec 16, 2016 at 12:11
  • 1
    @Programmer - Note that for a given JSON string, there are likely to be many possible schemas that could describe it, and validate it. There are some web-based utilities and specialized applications that can make a reasonable guess based on the instance you've provided, but it doesn't mean that this schema will be ideal to describe or validate other similar JSON instances. A Java library to perform this function could be useful as a starting point for you, but maybe not something you want to rely on without human intervention to review and refine the resulting schema. Commented Dec 16, 2016 at 19:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.