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.

  • @user3145373ツ - I don't need Java class, just the JSON schema. –  Dec 16 '16 at 12:06
  • Possible duplicate; https://stackoverflow.com/questions/7341537/tool-to-generate-json-schema-from-json-data?rq=1 –  Dec 16 '16 at 12:10
  • @RC. - I couldn't find a java based solution in that post. –  Dec 16 '16 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. – Ted Epstein Dec 16 '16 at 19:05

0 Answers0