public class OpenAPICodegenUtils extends Object
| Constructor and Description |
|---|
OpenAPICodegenUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
generateAPIdForSwagger(String apiDefPath)
Generate API Id for a given OpenAPI definition.
|
static ExtendedAPI |
generateAPIFromOpenAPIDef(String apiDefPath)
generate ExtendedAPI object from openAPI definition
|
static List<ResourceRepresentation> |
getAllResources(String projectName)
List all the resources available in the project
|
static String |
getBasePathFromSwagger(String apiDefPath)
get basePath from the openAPI definition
|
static ResourceRepresentation |
getResource(String projectName,
String resource_id)
get the resource related information if the resource_id is given
|
static List<ResourceRepresentation> |
listResourcesFromSwaggerForAPI(String projectName,
String apiId)
list all the available resources from openAPI definition
|
static String |
readJson(String filePath)
read openAPI definition
|
static void |
setAdditionalConfig(ExtendedAPI api) |
static void |
setAdditionalConfigsDevFirst(ExtendedAPI api)
set additional configurations for an api for code generation process (basePath and CORS configuration)
|
public static String generateAPIdForSwagger(String apiDefPath)
apiDefPath - path to OpenAPI definitionpublic static String getBasePathFromSwagger(String apiDefPath)
apiDefPath - path to openAPI definitionpublic static ExtendedAPI generateAPIFromOpenAPIDef(String apiDefPath)
apiDefPath - path to openAPI definitionpublic static List<ResourceRepresentation> listResourcesFromSwaggerForAPI(String projectName, String apiId)
projectName - project NameapiId - api Idpublic static List<ResourceRepresentation> getAllResources(String projectName)
projectName - project Namepublic static ResourceRepresentation getResource(String projectName, String resource_id)
projectName - project nameresource_id - resource idpublic static String readJson(String filePath)
filePath - path to openAPI definitionpublic static void setAdditionalConfigsDevFirst(ExtendedAPI api)
api - API objectpublic static void setAdditionalConfig(ExtendedAPI api)
Copyright © 2019 WSO2. All rights reserved.