- getSuccessResponse(operation) ⇒
Returns the response for either 200 or 201 response codes.
- translate(obj, spec, references) ⇒
Translates a value into a lookup table.
- resolveReference(obj, spec, references) ⇒
Resolves references to other objects in the spec or external specs.
- getReferenceName($ref) ⇒
Returns the last section of a JSON reference path.
- extractModelName($ref) ⇒
Extracts the model name from a JSON reference path.
- getMimeType(array) ⇒
Retreives the first mime type of a consumes or produces array.
- sortKeys(object) ⇒
Recreates an object with the keys sorted by their name (case insensitive).
- capitalize(string) ⇒
Capitalizes a string
- uncapitalize(string) ⇒
Uncapitalizes a string
- random(low, high) ⇒
Generates a random number within a given range
Returns the response for either 200 or 201 response codes.
Kind: global function
Returns: the response for 200 or 201 if found, null otherwise
Param | Type | Description |
---|---|---|
operation | object |
The operation object |
Translates a value into a lookup table.
Kind: global function
Returns: the translated value if found, otherwise the defaultValue if specified, or input value.
Param | Type | Description |
---|---|---|
obj | object |
The current reference object to resolve |
spec | object |
The current specification object |
references | object |
The references lookup object |
Resolves references to other objects in the spec or external specs.
Kind: global function
Returns: the object that contains the referenced object and spec.
Param | Type | Description |
---|---|---|
obj | object |
The current reference object to resolve |
spec | object |
The current specification object |
references | object |
The references lookup object |
Returns the last section of a JSON reference path.
Kind: global function
Returns: the referenced object's name
Param | Type | Description |
---|---|---|
$ref | object |
The reference path value |
Extracts the model name from a JSON reference path.
Kind: global function
Returns: the referenced object's model name
Param | Type | Description |
---|---|---|
$ref | object |
The reference path value |
Retreives the first mime type of a consumes or produces array.
Kind: global function
Returns: mime type if the array is populated, a default mime type otherwise
Param | Type | Description |
---|---|---|
array | Array.<string> |
The consumes or produces array |
Recreates an object with the keys sorted by their name (case insensitive).
Kind: global function
Returns: a new object with sorted keys
Param | Type | Description |
---|---|---|
object | object |
The object to sort |
Capitalizes a string
Kind: global function
Returns: the capitalized string value
Param | Type | Description |
---|---|---|
string | string |
The string to capitalize |
Uncapitalizes a string
Kind: global function
Returns: the uncapitalized string value
Param | Type | Description |
---|---|---|
string | string |
The string to uncapitalize |
Generates a random number within a given range
Kind: global function
Returns: the randomly generated number
Param | Type | Description |
---|---|---|
low | number |
The minimum value |
high | number |
The maximum value |