UNPKG

beach-day

Version:

API integration testing as fun as a day on the beach

18 lines (17 loc) 982 B
export declare class SwaggerUtils { /** * * 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] * * @param swaggerJSONPath {Object} The path the the JSON file * @param doNullableConversions {Object} Weather or not to do the nullable conversions, defaults to true * @param allowStringsToBeNumbers {Boolean} If true all string values will permit numbers too, defautls defaults to false * @returns {*} */ static parseSwaggerJSON(swaggerJSONPath: string, doNullableConversions?: boolean, allowStringsToBeNumbers?: boolean): any; static recurseSwagger(swaggerObj: any, allowStringsToBeNumbers?: boolean): any; }