Class JsonSchemaGenerator

java.lang.Object
Services.ResponseAnalyzer.JsonSchemaGenerator

public class JsonSchemaGenerator extends Object
Provides utilities to generate a JSON Schema from a JSON string.

This class uses an external service (running on localhost:4000) to convert a JSON payload into a corresponding JSON Schema representation.

  • Constructor Details

    • JsonSchemaGenerator

      public JsonSchemaGenerator()
  • Method Details

    • generateJSONSchema

      public static String generateJSONSchema(String json) throws IOException
      Generates a JSON Schema for the given JSON string by sending it to an external service.
      Parameters:
      json - the JSON string to generate a schema for
      Returns:
      the JSON Schema as a string
      Throws:
      IOException - if there is a network or I/O error while contacting the schema service