public class SwaggerGenerator extends Object
Constructor and Description |
---|
SwaggerGenerator() |
Modifier and Type | Method and Description |
---|---|
protected org.apache.synapse.api.API |
getAPIFromSynapseConfig(org.wso2.carbon.core.transports.CarbonHttpRequest request)
Returns API instance related to the URI in provided request.
|
protected String |
getApiNameFromRequestUri(String requestUri)
Extract API Name from the given URI.
|
protected void |
handleException(String errorMsg)
Logs the error message and throws New AxisFault.
|
protected String |
retrieveAPISwaggerFromRegistry(org.apache.synapse.api.API api,
String requestURI)
Function to extract swagger definition from the registry
|
protected void |
updateResponse(org.wso2.carbon.core.transports.CarbonHttpResponse response,
String responseString,
String contentType)
Update the response with provided response string.
|
protected void updateResponse(org.wso2.carbon.core.transports.CarbonHttpResponse response, String responseString, String contentType) throws org.apache.axis2.AxisFault
response
- CarbonHttpResponse which will be updatedresponseString
- String response to be updated in responsecontentType
- Content type of the response to be updated in response headaersException
- Any exception occured during the updateorg.apache.axis2.AxisFault
protected org.apache.synapse.api.API getAPIFromSynapseConfig(org.wso2.carbon.core.transports.CarbonHttpRequest request)
request
- CarbonHttpRequest which contains the request URI infoprotected String getApiNameFromRequestUri(String requestUri)
requestUri
- URI String of the requestprotected String retrieveAPISwaggerFromRegistry(org.apache.synapse.api.API api, String requestURI) throws org.wso2.carbon.registry.core.exceptions.RegistryException
api
- API objectrequestURI
- request URI infoorg.wso2.carbon.registry.core.exceptions.RegistryException
protected void handleException(String errorMsg) throws org.apache.axis2.AxisFault
errorMsg
- String message which contains error informationorg.apache.axis2.AxisFault
- throws with error informationCopyright © 2022 WSO2. All rights reserved.