(
map: ReadonlyMap<number, {
readonly ast: Option.Option<AST.AST>
readonly description: Option.Option<string>
}>,
defaultDescription: () => string
)
| 335 | } |
| 336 | |
| 337 | function processResponseMap( |
| 338 | map: ReadonlyMap<number, { |
| 339 | readonly ast: Option.Option<AST.AST> |
| 340 | readonly description: Option.Option<string> |
| 341 | }>, |
| 342 | defaultDescription: () => string |
| 343 | ) { |
| 344 | for (const [status, { ast, description }] of map) { |
| 345 | if (op.responses[status]) continue |
| 346 | op.responses[status] = { |
| 347 | description: Option.getOrElse(description, defaultDescription) |
| 348 | } |
| 349 | ast.pipe( |
| 350 | Option.filter((ast) => !HttpApiSchema.getEmptyDecodeable(ast)), |
| 351 | Option.map((ast) => { |
| 352 | const encoding = HttpApiSchema.getEncoding(ast) |
| 353 | op.responses[status].content = { |
| 354 | [encoding.contentType]: { |
| 355 | schema: processAST(ast) |
| 356 | } |
| 357 | } |
| 358 | }) |
| 359 | ) |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | function processParameters(schema: Option.Option<Schema.Schema.All>, i: OpenAPISpecParameter["in"]) { |
| 364 | if (Option.isSome(schema)) { |
no test coverage detected