Class GenericApiObjectDefinition
- java.lang.Object
-
- org.wso2.carbon.mediation.commons.rest.api.swagger.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 Summary
Constructors Constructor Description GenericApiObjectDefinition()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
convertYamlToJson(String yaml)
A util method to convert from YAML to JSON.static Map<String,Object>
getPathMap(org.apache.synapse.api.API api)
Provides structure for the "paths" element in swagger definition.
-
-
-
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.
-
-