parseSwaggerJSON(swaggerJSONPath: string, doNullableConversions?: boolean, allowStringsToBeNumbers?: boolean): any
Utility to load and parse a swagger JSON file
Note this method updates the swagger object by looking for schema keys of 'x-isnullable'
Then updating the object type to to be an array or original type and null
This allows you to support null schema checks using tv4 framework
e.g.: "type": "string" becomes "type":["string", null]
Parameters
swaggerJSONPath: string
The path the the JSON file
Default value doNullableConversions: boolean = true
Weather or not to do the nullable conversions, defaults to true
Default value allowStringsToBeNumbers: boolean = false
If true all string values will permit numbers too, defautls defaults to false
Returns any
Static recurseSwagger
recurseSwagger(swaggerObj: any, allowStringsToBeNumbers?: boolean): any
Parameters
swaggerObj: any
Default value allowStringsToBeNumbers: boolean = false
Utility to load and parse a swagger JSON file Note this method updates the swagger object by looking for schema keys of 'x-isnullable' Then updating the object type to to be an array or original type and null This allows you to support null schema checks using tv4 framework e.g.: "type": "string" becomes "type":["string", null]