Context
Architecture follow-up (not a P1; no failure in the common single-app layout).
@openapi registers into a process-wide registry at import time, and scan_endpoint_metadata() still writes into that global registry. So:
azure-functions-openapi generate --app my_module:app_a
imports my_module (registering @openapi metadata from every app defined there) and then scans app_a. The effective spec is closer to "all @openapi imported from module + metadata discovered from app_a" than to "spec for app_a". For a module defining both app_a and app_b, selecting app_a can still leak app_b's decorator metadata into the output.
#324 already introduced registry injection (registry= on generate_openapi_spec / collect_spec_warnings, with _collect_* falling back to _default_registry), so the plumbing exists to finish per-app isolation.
Acceptance Checklist
Out of scope
- Removing the global registry entirely.
- The empty-discovery warning wording (tracked separately).
References
Context
Architecture follow-up (not a P1; no failure in the common single-app layout).
@openapiregisters into a process-wide registry at import time, andscan_endpoint_metadata()still writes into that global registry. So:imports
my_module(registering@openapimetadata from every app defined there) and then scansapp_a. The effective spec is closer to "all@openapiimported from module + metadata discovered from app_a" than to "spec for app_a". For a module defining bothapp_aandapp_b, selectingapp_acan still leakapp_b's decorator metadata into the output.#324already introduced registry injection (registry=ongenerate_openapi_spec/collect_spec_warnings, with_collect_*falling back to_default_registry), so the plumbing exists to finish per-app isolation.Acceptance Checklist
scan_endpoint_metadata(app, registry=...)writing discovered operations into an injected/isolated registry rather than the global one.--app module:app_xto build a spec scoped to operations belonging to the selected app.@openapihandlers, yields a spec containing only the selected app's operations.function_app.pylayout (global registry default).Out of scope
References
src/azure_functions_openapi/spec.py(_collect_skew_warnings,_collect_discovery_warningsglobal fallback)