public class taOpenApi
extends java.lang.Object
Usage: taOpenApi oapi = new taOpenApi("c:\\test\\service.json"); boolean ok = oapi.parseJsonFile(); if (!ok) System.out.println("Error parsing JSON file: "+oapi.getLastError().getMessage()); Vector v = oapi.getOperationList(); taOpenApi.Operation op = oapi.getOperation("/api/Version|get"); taOpenApi.RequestBody rb = op.getRequestBody("application/json"); String example = rb.getExample();
Modifier and Type | Class and Description |
---|---|
class |
taOpenApi.Operation
Class that represents an OAS Operation object
Cannot be instanciated directly. |
class |
taOpenApi.Parameter
Class that represents an OAS Parameter object
Cannot be instanciated directly. |
class |
taOpenApi.RequestBody
Class that represents an OAS RequestBody object
Cannot be instanciated directly. |
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
stClassName |
protected static java.lang.String |
stVersion |
Constructor and Description |
---|
taOpenApi(java.lang.String stFilePath)
Create a new instance of taOpenApi
|
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
getLastError()
Get the last Throwable that occurred.
|
taOpenApi.Operation |
getOperation(java.lang.String operationName)
Gets an taOpenApi.Operation instance
|
java.util.Vector |
getOperationList()
Get the list of available operations.
|
java.util.Vector |
getServerBaseURLs()
Get the list of server base URLs
|
static java.util.Vector |
getVariables(java.lang.String string)
Returns the variables found in the passed string.
|
static java.lang.String |
getVersion()
Get the version of this class
|
boolean |
parseJsonFile()
Parse the JSON file
|
protected static java.lang.String stVersion
protected static java.lang.String stClassName
public taOpenApi(java.lang.String stFilePath)
stFilePath
- The OAS file, must be in JSON format and UTF-8 encodedpublic static java.lang.String getVersion()
public java.lang.Throwable getLastError()
public taOpenApi.Operation getOperation(java.lang.String operationName)
operationName
- The path and verb as returned by getOperationList()
e.g. /api/Version|getpublic java.util.Vector getOperationList()
public java.util.Vector getServerBaseURLs()
public static java.util.Vector getVariables(java.lang.String string)
string
- public boolean parseJsonFile()