(&self, openapi: &mut utoipa::openapi::OpenApi)
| 615 | |
| 616 | impl Modify for MergeAddon { |
| 617 | fn modify(&self, openapi: &mut utoipa::openapi::OpenApi) { |
| 618 | let api_documentation = api_documentation(); |
| 619 | |
| 620 | let api_components = api_documentation |
| 621 | .iter() |
| 622 | .cloned() |
| 623 | .filter_map(|api_docs| { |
| 624 | api_docs |
| 625 | .components |
| 626 | .map(|components| components.schemas.into_iter()) |
| 627 | }) |
| 628 | .flatten(); |
| 629 | |
| 630 | let mut components = openapi.components.take().unwrap_or_default(); |
| 631 | components.schemas.extend(api_components); |
| 632 | openapi.components = Some(components); |
| 633 | |
| 634 | let mut tags = openapi.tags.take().unwrap_or_default(); |
| 635 | tags.extend( |
| 636 | api_documentation |
| 637 | .iter() |
| 638 | .cloned() |
| 639 | .filter_map(|api_docs| api_docs.tags) |
| 640 | .flatten(), |
| 641 | ); |
| 642 | openapi.tags = Some(tags); |
| 643 | |
| 644 | openapi.paths.paths.extend( |
| 645 | api_documentation |
| 646 | .iter() |
| 647 | .cloned() |
| 648 | .flat_map(|api_docs| api_docs.paths.paths.into_iter()), |
| 649 | ); |
| 650 | } |
| 651 | } |
| 652 | |
| 653 | struct ExternalRefAddon; |
nothing calls this directly
no test coverage detected