Skip to content

Instantly share code, notes, and snippets.

tommyjcarpenter /
Last active August 2, 2023 14:28
combine a local openapi.yaml with a remote definitions file, to eliminate the remote refs
from typing import Any
import requests
import ruamel.yaml
def remove_unused(d: Any) -> None:
trims all schemas in components/schemas that are not referenced in the spec