MCPcopy Create free account
hub / github.com/hashintel/hash / modify

Method modify

libs/@local/graph/api/src/rest/mod.rs:617–650  ·  view source on GitHub ↗
(&self, openapi: &mut utoipa::openapi::OpenApi)

Source from the content-addressed store, hash-verified

615
616impl 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
653struct ExternalRefAddon;

Callers

nothing calls this directly

Calls 15

api_documentationFunction · 0.85
entryMethod · 0.80
values_mutMethod · 0.80
requiredMethod · 0.80
max_itemsMethod · 0.80
min_itemsMethod · 0.80
nullableMethod · 0.80
clonedMethod · 0.45
iterMethod · 0.45
mapMethod · 0.45
into_iterMethod · 0.45
takeMethod · 0.45

Tested by

no test coverage detected