Class 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 Detail

      • GenericApiObjectDefinition

        public GenericApiObjectDefinition()
    • Method Detail

      • getPathMap

        public static Map<String,​Object> getPathMap​(org.apache.synapse.api.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.