Class GenericApiObjectDefinition

java.lang.Object
org.eclipse.lemminx.customservice.synapse.api.generator.GenericApiObjectDefinition

public class GenericApiObjectDefinition extends Object
Generalized object structure for Swagger definitions of APIs. This structure contains set of Maps which compatible with both JSON and YAML formats.
  • Constructor Details

    • GenericApiObjectDefinition

      public GenericApiObjectDefinition()
  • Method Details

    • getPathMap

      public static Map<String,Object> getPathMap(API api)
      Provides structure for the "paths" element in swagger definition.
      Returns:
      Map containing information for paths element
    • convertYamlToJson

      public static String convertYamlToJson(String yaml) throws com.fasterxml.jackson.core.JsonProcessingException
      A util method to convert from YAML to JSON.
      Parameters:
      yaml - YAML input as string.
      Returns:
      converted JSON as string.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - error occurred while parsing the JSON.