Class ClassToJsonSchemaExtensions


  • public class ClassToJsonSchemaExtensions
    extends java.lang.Object
    The class ClassToJsonSchemaExtensions converts java class objects to json schema object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> com.fasterxml.jackson.module.jsonSchema.JsonSchema toJsonSchema​(java.lang.Class<T> clazz)
      Transforms the given java class object to json schema
      static <T> java.lang.String toJsonSchemaAsString​(java.lang.Class<T> clazz)
      Transforms the given java class object to json schema as string
      static java.lang.String toString​(com.fasterxml.jackson.module.jsonSchema.JsonSchema schema)
      Transforms the given java class object to json schema as string
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassToJsonSchemaExtensions

        public ClassToJsonSchemaExtensions()
    • Method Detail

      • toString

        public static java.lang.String toString​(com.fasterxml.jackson.module.jsonSchema.JsonSchema schema)
                                         throws com.fasterxml.jackson.core.JsonProcessingException
        Transforms the given java class object to json schema as string
        Parameters:
        schema - the JsonSchema object
        Returns:
        the json schema as string
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - If an error occurs when converting object to String
      • toJsonSchemaAsString

        public static <T> java.lang.String toJsonSchemaAsString​(java.lang.Class<T> clazz)
                                                         throws com.fasterxml.jackson.core.JsonProcessingException
        Transforms the given java class object to json schema as string
        Type Parameters:
        T - the generic type
        Parameters:
        clazz - the clazz
        Returns:
        the json schema as string
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - If an error occurs when converting object to String
      • toJsonSchema

        public static <T> com.fasterxml.jackson.module.jsonSchema.JsonSchema toJsonSchema​(java.lang.Class<T> clazz)
                                                                                   throws com.fasterxml.jackson.core.JsonProcessingException
        Transforms the given java class object to json schema
        Type Parameters:
        T - the generic type
        Parameters:
        clazz - the clazz
        Returns:
        the json schema
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - If an error occurs when converting object to String