Problem
A C# microservice generates its OpenAPI document by reflecting over all of its registered types (routes plus request/response schemas) to build the schema set. This generation runs in full on every GET admin/docs request. On CPU-constrained instances, repeated polling of admin/docs produces repeated full reflection scans and adds significant, avoidable CPU load.
Expected
The OpenAPI document cannot change over the lifetime of a running microservice instance -- its routes and types are fixed at build time. After the document is generated once (at or after boot), admin/docs should return an identical, cached document without re-running the reflection scan.
Actual
Each admin/docs request re-runs the full reflection walk and rebuilds the document from scratch. Observed in production: one complete reflection pass over the service's schema types (hundreds of types) per request, i.e. one CPU-expensive scan for every hit. A client or probe polling admin/docs therefore drives one full scan per poll, which is enough to be a meaningful load on a small instance.
Problem
A C# microservice generates its OpenAPI document by reflecting over all of its registered types (routes plus request/response schemas) to build the schema set. This generation runs in full on every
GET admin/docsrequest. On CPU-constrained instances, repeated polling ofadmin/docsproduces repeated full reflection scans and adds significant, avoidable CPU load.Expected
The OpenAPI document cannot change over the lifetime of a running microservice instance -- its routes and types are fixed at build time. After the document is generated once (at or after boot),
admin/docsshould return an identical, cached document without re-running the reflection scan.Actual
Each
admin/docsrequest re-runs the full reflection walk and rebuilds the document from scratch. Observed in production: one complete reflection pass over the service's schema types (hundreds of types) per request, i.e. one CPU-expensive scan for every hit. A client or probe pollingadmin/docstherefore drives one full scan per poll, which is enough to be a meaningful load on a small instance.