INNER CODE UNIT · Python

walk

skygazer42/MimirQ · app/main.py:489

    def walk(node: object) -> None:
        if isinstance(node, dict):
            if node.get("type") == "object":
                props = node.get("properties")
                if (not props) and ("additionalProperties" not in node):
                    node["additionalProperties"] = True
            for v in node.values():
                walk(v)
            return
        if isinstance(node, list):
            for v in node:
                walk(v)

    walk(spec)


def custom_openapi():  # noqa: ANN201
    if app.openapi_schema:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…