(path, method)
| 29 | * @returns string|null |
| 30 | */ |
| 31 | const getValidationSchema = (path, method) => { |
| 32 | if ( |
| 33 | compiledSchema !== null && |
| 34 | typeof compiledSchema.paths[path] !== "undefined" && |
| 35 | typeof compiledSchema.paths[path][method] !== "undefined" && |
| 36 | typeof compiledSchema.paths[path][method].requestBody !== "undefined" && |
| 37 | typeof compiledSchema.paths[path][method].requestBody.content !== "undefined" && |
| 38 | typeof compiledSchema.paths[path][method].requestBody.content["application/json"] !== "undefined" && |
| 39 | typeof compiledSchema.paths[path][method].requestBody.content["application/json"].schema !== "undefined" |
| 40 | ) { |
| 41 | return compiledSchema.paths[path][method].requestBody.content["application/json"].schema; |
| 42 | } |
| 43 | return null; |
| 44 | }; |
| 45 | |
| 46 | export { getCompiledSchema, getValidationSchema }; |
no outgoing calls
no test coverage detected