Interface IJSONAdapterFactory


public interface IJSONAdapterFactory
Register OSGi services under this interface to enable adaptation of a object to a different object that is more suitable for usage in JSON
  • Method Details

    • adapt

      Object adapt(Object adaptableObject) throws Exception
      adapt the given object to another object that is more suitable for JSON
      Parameters:
      adaptableObject - the object to adapt
      Returns:
      the adapted object or the original object if no suitable adapter was found
      Throws:
      Exception
    • getSchemaFields

      Map<String,Object> getSchemaFields(Class<?> clazz, Map<String,Object> schemasMap, Map<String,Class<?>> usedSchemaNamesMap) throws Exception
      Get the schema type for the openapi
      Parameters:
      clazz - the type
      schemasMap - the map of already existing schemas
      usedSchemaNamesMap - map of already used schema names to ensure unique names
      Returns:
      the map of fields for the schema (typically contains "type" + "format" or "$ref" keys)
      Throws:
      Exception