-
determineQueryType(param)
-
Determines the proper type for the Query parameter
Parameters:
Name |
Type |
Description |
param |
object
|
sway Parameter object to investigate |
Returns:
-
Type
-
string
-
isNumberType(type)
-
evaluates if the given type is an OpenAPI number type or not
Parameters:
Name |
Type |
Description |
type |
string
|
type to be evaluated |
Returns:
-
Type
-
boolean
-
lookupCustomValue(name, location, code, op, path, options)
-
resolves any custom values available for the given parameter
Parameters:
Name |
Type |
Description |
name |
string
|
parameter name being looked up |
location |
string
|
where the parameter is in the request/response |
code |
number
|
response status code being evaluated |
op |
string
|
the operation method being processed |
path |
string
|
API path being processed |
options |
object
|
for use in looking up the custom value |
Returns:
-
Type
-
any
-
pathify(path, param, value)
-
replaces the path paremeter in the given URL path with a sample value
Parameters:
Name |
Type |
Description |
path |
string
|
URL path to be pathified |
param |
object
|
sway Parameter object to use in pathify |
value |
string
|
number
|
a custom value to use in the pathify |
Returns:
-
Type
-
string
-
process(api, options)
-
Processes the given API spec, creating test data artifacts
Parameters:
Name |
Type |
Description |
api |
object
|
API spec object to be processed |
options |
object
|
options to be used during processing |
Returns:
-
Type
-
processing.ProcessedSpec
-
-
Determines the request headers for a transaction
Parameters:
Name |
Type |
Description |
responseCode |
string
|
response code being processed |
op |
object
|
parent operation object |
path |
object
|
parent path object |
top |
object
|
global properties |
options |
object
|
for use in processing headers |
Returns:
-
Type
-
object
-
processOperations(api, parentPath, topLevel, options)
-
Processes the operations of the given Path object
Parameters:
Name |
Type |
Description |
api |
object
|
parsed OpenAPI spec object |
parentPath |
object
|
sway Path object being processed |
topLevel |
object
|
global spec properties |
options |
object
|
options to use during processing |
Returns:
-
Type
-
Array.<processing.ProcessedOp>
-
processParams(code, op, path, options)
-
Processes the parameters of a Path + Operation for use in a test
Parameters:
Name |
Type |
Description |
code |
number
|
response status code being processed |
op |
object
|
sway Operation object that's being processed |
path |
object
|
sway Path object that's being process |
options |
object
|
options to use during processing |
Returns:
-
Type
-
processing.ProcessedParams
-
processPaths(api, topLevel, options)
-
Processes the paths defined by the api spec, or indicated by the options
Parameters:
Name |
Type |
Description |
api |
object
|
parsed OpenAPI spec object |
topLevel |
object
|
global spec properties |
options |
object
|
options to use during processing |
Returns:
-
Type
-
Array.<processing.ProcessedPath>
-
processResponse(res, op, path, options)
-
Processes a sway Response for use in a test
Parameters:
Name |
Type |
Description |
res |
object
|
sway Response object being processed |
op |
string
|
the operation method being processed |
path |
string
|
API path being processed |
options |
object
|
options to use during processing |
Returns:
-
Type
-
processing.ExpectedResponse
-
processTransactions(api, parentOp, parentPath, topLevel, options)
-
Processes the transactions for a given Path + Operation
Parameters:
Name |
Type |
Description |
api |
object
|
parsed OpenAPI spec object |
parentOp |
object
|
parent sway Operation object being processed |
parentPath |
object
|
parent sway Path object being processed |
topLevel |
object
|
global spec properties |
options |
object
|
options to use during processing |
Returns:
-
Type
-
Array.<processing.ProcessedTransaction>
-
replaceNewlines(str)
-
Used to replace newlines with a space in each response.description
Parameters:
Name |
Type |
Description |
str |
string
|
string to replace newlines with spaces |
Returns:
-
Type
-
string